Longest Valid Parentheses
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Given a string containing just the characters '(' and ')'. Find the length of the longest valid (well-formed) parentheses substring.
Input
One string consisting of characters '(' and ')' of length no more than 10^6
.
Output
Print the length of the longest well-formed parentheses substring.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 17%