AOC/2022/day01/part1.py

12 lines
247 B
Python
Raw Normal View History

2024-08-29 11:12:29 -04:00
f = open("file", "r")
str = f.read()
f.close()
lst = []
for paquet in str.split("\n\n"):
Sum = 0;
for sub_paquet in paquet.split("\n"):
if (sub_paquet != ""):
Sum += int(sub_paquet)
lst.append(Sum);
print(max(lst))