 All Problems
Maximum Nesting Depth of the Parentheses
easy
strings
stack
amazon
google

Given a valid parentheses string s (may contain other characters), return the nesting depth (maximum number of nested open parentheses at any point).

Example 1:

Input: (1+(2*3)+((8)/4))+1
Output: 3

Example 2:

Input: (1)+((2))+(((3)))
Output: 3

Input format: A string.

Output format: Maximum nesting depth.

Run to check your code against the sample cases, or submit to run every case