AdventOfCode/Python/2022/04.py
2023-10-20 13:52:47 +02:00

9 lines
219 B
Python

from lib import *
input = read_input(2022, 4)
lines = [*map(pints, input.splitlines())]
print(sum(a <= c <= d <= b or c <= a <= b <= d for a, b, c, d in lines))
print(sum(d >= a and c <= b for a, b, c, d in lines))