advent-of-code/2022/day1.py
2023-01-06 13:48:18 +01:00

10 lines
222 B
Python

# -*- encoding: utf-8 -*-
import sys
blocks = sys.stdin.read().split("\n\n")
values = sorted(sum(map(int, block.split())) for block in blocks)
print(f"answer 1 is {values[-1]}")
print(f"answer 2 is {sum(values[-3:])}")