aoc2022/01/2022-12-01-B.py
2022-12-02 19:58:12 +01:00

9 lines
253 B
Python
Executable file

#!/usr/bin/env python3
with open("01/2022-12-01-input.txt", "r") as f:
elves = [x.split("\n") for x in f.read().split("\n\n")]
ints = [[int(j) for j in i] for i in elves]
sums = sorted([sum(i) for i in ints])
print(sum(sums[-3:]))