aoc/2015/three/solution.py
2025-05-01 12:38:17 +03:00

17 lines
412 B
Python

with open("./input", "r") as f:
instructions = list(f.read())
cursor = [0,0]
houses = []
for instruction in instructions:
if instruction == "^":
cursor[0] += 1
if instruction == "v":
cursor[0] -= 1
if instruction == ">":
cursor[1] += 1
if instruction == "<":
cursor[1] -= 1
houses.append(f"{cursor[0]},{cursor[1]};")
print(houses)
print(len(set(houses)))