- Time : O(|s|)
- Space : O(|s|)
c++
1 | int Solution::longestValidParentheses(string A) { |