Files
python-aoc-2022/day04/part2.py
Sebastian Seedorf b4fe10e101 Day 04
2022-12-05 09:41:21 +01:00

10 lines
245 B
Python

#!/usr/bin/env python3
lines = (x.strip() for x in open("input.txt"))
s = 0
for line in lines:
a, b, x, y = map(int, line.replace(',', '-').split('-'))
s += 1 if x <= a <= y or x <= b <= y or a <= x <= b or a <= y <= b else 0
print(s)