resolve Longest_Valid_Parentheses