30. Longest Valid Parentheses
Given a string containing only parentheses, return the length of the longest valid parentheses substring.
Contoh 1:
Input: s = "(()" Output: 2
Contoh 2:
Input: s = ")()())" Output: 4
Batasan:
0 <= s.length <= 3 * 10^4
Given a string containing only parentheses, return the length of the longest valid parentheses substring.
Input: s = "(()" Output: 2
Input: s = ")()())" Output: 4
0 <= s.length <= 3 * 10^4