Given a string containing just the characters '(' and ')', return the length of the longest valid (well-formed) parentheses substring.
Initialize stack with -1 as base index
(
0
1
)
2
Stack (indices)
-1
Index:
Max Length:
Current
Valid
In Stack