aoc2015/d01/part2.py

11 lines
150 B
Python

import sys
s = sys.stdin.read()[:-1]
f = 0
for i,c in enumerate(s):
f += -1 if c == ')' else 1
if f == -1:
print(i+1)
break