You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
261 B

filename = "inputs/day1.input"
file = open(filename, "rb").readlines()
inputs = file
inputs = [int(x) for x in inputs]
counter = 0
for i in range(len(inputs) - 3):
if sum(inputs[i + 1 : i + 4]) > sum(inputs[i : i + 3]):
counter += 1
print(counter)