2021 day 1
This commit is contained in:
14
2021/01/part1
Executable file
14
2021/01/part1
Executable 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)
|
||||
|
Reference in New Issue
Block a user