Maximum Nesting Depth of Parentheses

Easy
Strings String Stack

Given a VPS, return the nesting depth.

Constraints

1 ≤ len ≤ 100

Examples

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

Install Talent Arabia

Get instant access to jobs and career tools on your device.