aoc
/
2022
1
0
Fork 0
2022/day01.py

14 lines
261 B
Python

import sys
def main():
input = sys.stdin.read().strip().split("\n\n")
elves = sorted(sum(int(i) for i in elf.split("\n")) for elf in input)
print("Part 1:", elves[-1])
print("Part 2:", sum(elves[-3:]))
if __name__ == "__main__":
main()