Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Simple solution in Clear category for How Deep by Pouf
def how_deep(structure):
depth, max_depth = 0, 0
for c in str(structure):
if c == "(":
depth += 1
max_depth = max(depth, max_depth)
elif c == ")":
depth -= 1
return max_depth
June 29, 2020
Comments: