aoc2015/d01/part1.py

7 lines
84 B
Python
Raw Permalink Normal View History

2023-12-01 09:42:13 +00:00
import sys
s = sys.stdin.read()[:-1]
print(sum(map(lambda c: [-1,1][c=='('],s)))