Advent-of-Code/2015/day 1/P2/flor.py

11 lines
204 B
Python
Raw Permalink Normal View History

2019-12-01 17:44:00 +01:00
instructions = open("input.txt").read()
flor = 0
for c, i in enumerate(list(instructions)):
if i == "(":
flor+=1
elif i == ")":
flor-=1
if flor == -1:
break
print(c+1)