Given a string containing ‘(‘ and ‘)’, find the length of longest valid (well-formed) parentheses substring. For “(()”, the longest valid parentheses substring is “()”, which has length = 2; Another example is “)()())”, where the longest valid parentheses substring is “()()”, which has length = 4;
近期评论