Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for How Deep by RJPython
def how_deep(structure):
check, depth = 0, 0
for x in str(structure):
if x == '(':
check += 1
if check > depth:
depth = check
elif x == ')':
check -= 1
return depth
Aug. 28, 2020
Comments: