aoc2015/d01/part2.py

11 lines
150 B
Python
Raw Normal View History

2023-12-01 09:42:13 +00:00
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