2
1
Fork 0
aoc2021/02/solution_1.py

10 lines
259 B
Python
Executable File

#!/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"])