commit
df3822bee4
@ -0,0 +1,11 @@
|
||||
f = open("input.txt", "r")
|
||||
lines = f.readlines()
|
||||
current = 0
|
||||
calories = []
|
||||
for line in lines:
|
||||
if line == "\n":
|
||||
calories.append(current)
|
||||
current = 0
|
||||
else:
|
||||
current = current + int(line)
|
||||
print(max(calories))
|
@ -0,0 +1,11 @@
|
||||
f = open("input.txt", "r")
|
||||
lines = f.readlines()
|
||||
current = 0
|
||||
calories = []
|
||||
for line in lines:
|
||||
if line == "\n":
|
||||
calories.append(current)
|
||||
current = 0
|
||||
else:
|
||||
current = current + int(line)
|
||||
print(sum(sorted(calories)[-3:]))
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue