diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2021-11-24 22:25:42 +0000 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2021-11-24 22:25:42 +0000 |
commit | a7a6b86002b595bc167af72606b14c67ed1bdf8f (patch) | |
tree | bff94329cf969bd9df68d3b9782fee2107db56c2 /1/2.py | |
download | aoc2015-a7a6b86002b595bc167af72606b14c67ed1bdf8f.tar.gz aoc2015-a7a6b86002b595bc167af72606b14c67ed1bdf8f.tar.xz aoc2015-a7a6b86002b595bc167af72606b14c67ed1bdf8f.zip |
init commit
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)) |