diff options
Diffstat (limited to '1/2.py')
-rw-r--r-- | 1/2.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -0,0 +1,6 @@ +def sumiter(i): + count = 0 + for e in i: + count += e + yield count +print(next(i + 1 for i, s in enumerate(sumiter({'(': 1, ')': -1}[c] for c in open('input').read().rstrip('\n'))) if s == -1)) |