parent
1ba863a06f
commit
343e93b59d
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