This commit is contained in:
Sebastian Seedorf
2022-12-05 09:41:21 +01:00
parent 9da1101818
commit b4fe10e101
3 changed files with 1020 additions and 0 deletions

10
day04/part1.py Normal file
View File

@@ -0,0 +1,10 @@
#!/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 b >= x <= a <= y >= b or y >= a <= x <= b >= y else 0
print(s)