]> git.friedersdorff.com Git - max/aoc_2022.git/blob - 1_2.py
Do day 7
[max/aoc_2022.git] / 1_2.py
1 all_of_them = []
2 current = 0
3
4 with open("1_1.in") as fh:
5     for line in fh:
6         line = line.strip()
7         if not line:
8             all_of_them.append(current)
9             current = 0
10             continue
11
12         current += float(line)
13
14 all_of_them.sort(reverse=True)
15 print(sum(all_of_them[:3]))