Day 3
This commit is contained in:
12
day03/part1.py
Normal file
12
day03/part1.py
Normal file
@@ -0,0 +1,12 @@
|
||||
lines = (x.strip() for x in open("input.txt"))
|
||||
|
||||
pos = 0
|
||||
count = 0
|
||||
|
||||
for line in lines:
|
||||
pos = pos % len(line)
|
||||
if line[pos] == '#':
|
||||
count += 1
|
||||
pos += 3
|
||||
|
||||
print(count)
|
||||
Reference in New Issue
Block a user