2
1
Fork 0
aoc2021/01/solution.py

10 lines
280 B
Python
Raw Permalink Normal View History

2021-12-01 10:42:43 +01:00
#!/usr/bin/env python3
with open("input.txt", "r") as _input:
data = [int(l) for l in _input.readlines()]
sliding_sums = [sum(v) for v in zip(data, data[1:], data[2:])]
answer = [b > a for a, b in zip(sliding_sums, sliding_sums[1:])].count(True)
print(f"Answer: {answer}")