Day 03 (minified)

This commit is contained in:
Sebastian Seedorf
2021-12-04 19:57:36 +01:00
parent 37cd737f3a
commit 53abaa4d01
3 changed files with 5 additions and 0 deletions

View File

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