2021 day 1

This commit is contained in:
2022-01-09 17:50:50 +00:00
parent bf5c0da352
commit d7416215e7
3 changed files with 2039 additions and 0 deletions

14
2021/01/part1 Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env python
last_depth = -1
count = 0
with open('input') as f:
for line in f:
depth = int(line)
if last_depth > 0 and last_depth < depth:
count = count +1
last_depth = depth
print(count)