curIndex: Longest Valid Parentheses