Initial commit with day 1, part 1.

This commit is contained in:
David Vereb 2021-12-02 10:26:14 -05:00
commit 34121bfb96
3 changed files with 2021 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*~

2000
2021/1/input Normal file

File diff suppressed because it is too large Load Diff

19
2021/1/main.py Normal file
View File

@ -0,0 +1,19 @@
with open('input', 'r') as fp:
last = int(fp.readline().rstrip())
increment = 0
decrement = 0
same = 0
for line in fp:
amt = int(line)
if(amt > last):
increment = increment + 1
elif(amt < last):
decrement = decrement + 1
else:
same = same + 1
last = amt
print increment, ",", decrement, ",", same