Last active 1669865081

aoc 2022

Alyssa Smith revised this gist 1669901081. Go to revision

1 file changed, 6 insertions

aoc1.py(file created)

@@ -0,0 +1,6 @@
1 + with open("aoc1.txt") as f:
2 + data = f.read().strip()
3 + elves = [list(map(int,_.split("\n"))) for _ in data.split("\n\n")]
4 + ans1 = max(sum(_) for _ in elves)
5 + ans2 = sum(sorted(sum(_) for _ in elves)[-3:])
6 + print(ans1,ans2)
Newer Older