aoc2021/d01/d01_2.py

4 lines
110 B
Python

import sys
L = [int(l[:-1]) for l in sys.stdin.readlines()]
print(sum([0,1][a<b] for (a,b) in zip(L, L[3:])))