aoc-2021/day_1/code.py
2021-12-05 16:52:20 +01:00

14 lines
266 B
Python

import fileinput
previous = None
count = 0
for i,line in enumerate(fileinput.input()):
try:
val = int(line.strip())
except ValueError:
continue
if previous != None and val > previous:
count += 1
previous = val
print(count)