30. Longest Valid Parentheses
Given a string containing only parentheses, return the length of the longest valid parentheses substring.
उदाहरण 1:
इनपुट: s = "(()" आउटपुट: 2
उदाहरण 2:
इनपुट: s = ")()())" आउटपुट: 4
सीमाएँ:
0 <= s.length <= 3 * 10^4
Given a string containing only parentheses, return the length of the longest valid parentheses substring.
इनपुट: s = "(()" आउटपुट: 2
इनपुट: s = ")()())" आउटपुट: 4
0 <= s.length <= 3 * 10^4