my advent of code 2021 solutions
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.

12 lines
324 B

f = open('input.txt', 'r')
input = f.readlines()
count = 0
for i in range(len(input)):
input[i] = input[i].strip()
input[i] = int(input[i])
for x in range(len(input) - 3):
a = input[x] + input[x + 1] + input[x + 2]
b = input[x + 1] + input[x + 2] + input[x + 3]
if a < b:
count += 1
print(count)