advent-of-code-2022/day01/golf.py

4 lines
179 B
Python

d=sorted([sum(map(int,x))for x in[z.split()for z in open(0).read().split("\n\n")]]);print(d[-1],sum(d[-3:]))
# 108 bytes, requires piped input. `cat input.txt | python3 golf.py`