Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for How Deep by _Chico_
def how_deep(structure):
max_depth,depth = 1,0
for char in str(structure):
if char in ['(', '[']:depth += 1
elif char in [')', ']']:max_depth = max(depth, max_depth);depth = 1
return max_depth
July 9, 2021