longest-valid-parentheses.cpp leetcode