You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

14 lines
254 B

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