parent
1d668e3192
commit
35d86b41b7
2 changed files with 16 additions and 2 deletions
@ -0,0 +1,14 @@ |
||||
lines = [i for i in open("input.txt", 'r').read().splitlines()] |
||||
|
||||
elves = [] |
||||
summa = 0 |
||||
for l in lines: |
||||
if l == "": |
||||
elves.append(summa) |
||||
summa = 0 |
||||
else: |
||||
summa += int(l) |
||||
|
||||
top3 = sorted(elves)[-3:] |
||||
print(top3) |
||||
print(sum(top3)) |
Loading…
Reference in new issue