aoc2021/1/a.py

15 lines
205 B
Python

with open("input.txt") as f:
lines = [int(i) for i in f.readlines()]
hits = 0
last = None
for line in lines:
if last is not None and line > last:
hits += 1
last = line
print(hits)