PythiloHard · 40 min · Task 92 of 100 · progress kept in this browser

Longest valid parentheses span

Return the length of the longest contiguous well-formed parentheses substring. Input contains only opening and closing parentheses.

unmatched = [-1, 0]
closing_index = 1
unmatched.pop()
print(closing_index-unmatched[-1])
Your task

Return the length of the longest contiguous well-formed parentheses substring. Input contains only opening and closing parentheses.