Maximum nesting depth of a paranthesis expression
Given a parenthesis expression, We have to find the maximum nesting depth. For example: the expression ()((()))(()) has a maximum nesting depth of 3. The expression ((()())) has a maximum nesting depth of 3. Let us output -1 for an unbalanced expressions such as (())) or ()( This is a simple problem that can be…