aoc2020/03/1.py

6 lines
194 B
Python
Raw Permalink Normal View History

2020-12-03 14:19:28 +00:00
lines = open("input", "r").read().split("\n")
lines = [l for l in lines if l]
visited = [l[(i*3)%len(l)] for i, l in enumerate(lines)]
trees = [t for t in visited if t == "#"]
print(len(trees))