17 lines
278 B
Python
17 lines
278 B
Python
from lib import get_data
|
|
|
|
data = get_data(__file__)
|
|
|
|
t = sum((1 if c == "(" else -1 for c in data))
|
|
print(t)
|
|
|
|
floor = 0
|
|
for i, c in enumerate(data):
|
|
if c == "(":
|
|
floor += 1
|
|
elif c == ")":
|
|
floor -= 1
|
|
if floor == -1:
|
|
print(i + 1)
|
|
break
|