aoc2025/brechtje/5/5-1.py

19 lines
373 B
Python

input = open('input.txt', 'r').read().splitlines()
ranges = []
food = []
answer = 0
for line in input:
if '-' in line:
ranges.append(list(map(int, line.split('-'))))
elif line != '':
food.append(int(line))
for item in food:
for range in ranges:
if range[0] <= item <= range[1]:
answer += 1
break
print(answer)