A repro for all my Advent of ode tasks
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.

21 lines
391 B

import os
dir = os.path.dirname(os.path.abspath(__file__))
input_file = open(os.path.join(dir, './input.txt'), 'r')
lines = input_file.readlines()
last_depth = -1
count = 0
for line in lines:
int_value = int(line)
if last_depth == -1:
last_depth = int_value
continue
if int_value > last_depth:
count = count+1
last_depth = int_value
print(count)