Return the length of the longest contiguous substring of s that is a well-formed parentheses sequence.
Input / output
s: stringExamples
"(()" returns 2.")()())" returns 4 from "()()".Constraints
0 <= s.length <= 100,000s contains only ( and )Follow-up Compare stack, dynamic-programming, and two directional counter scans.