Day 02 (minify)

This commit is contained in:
Sebastian Seedorf
2021-12-02 13:22:14 +01:00
parent 53270a7a90
commit 646e139a19
4 changed files with 8 additions and 2 deletions

3
day02/part1.min.py Normal file
View File

@@ -0,0 +1,3 @@
h,d=0,0
for c,s in(x.strip().split()for x in open("input.txt")):v=int(s);h,d=(h+v,d)if c[0]=='f'else(h,d+(-v if c=='up'else v))
print(h*d)