16 lines
292 B
Python
16 lines
292 B
Python
with open("input.txt") as f:
|
|
lines = [int(i) for i in f.readlines()]
|
|
|
|
|
|
hits = 0
|
|
winsize = 3
|
|
last = None
|
|
|
|
for i in range(0, len(lines) - 2):
|
|
window = sum([lines[i], lines[i + 1], lines[i + 2]])
|
|
if last is not None and window > last:
|
|
hits +=1
|
|
last = window
|
|
|
|
print(hits)
|