2
1
Fork 0
aoc2021/02/solution_1.py

10 lines
259 B
Python
Raw Normal View History

2021-12-02 10:49:11 +01:00
#!/usr/bin/env python3
from collections import defaultdict
d = defaultdict(int)
with open("input.txt", "r") as _input:
for i, n in [x.split(' ') for x in _input.readlines()]:
d[i] += int(n)
print("Answer:", (d["down"] - d["up"]) * d["forward"])