Maximum Nesting Depth of Two Valid Parentheses Strings

Solution Code

Time Complexity

O(n)

Space Complexity

O(1)