AOC/2022/day01/part1.py
2024-08-29 17:12:29 +02:00

12 lines
247 B
Python

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))