algorithm · Level 3 · 35 min
Given a string containing just the characters ( and ), find the length of the longest valid (well-formed) parentheses substring.
s of '(' and ')'.- `0 <= s.length <= 3 * 10^4` - `s[i]` is `'('` or `')'`.
Return the length (number) of the longest valid substring.