modified Longest Valid Parentheses