#1614

Maximum Nesting Depth of the Parentheses

easy · 84.8% accepted · 2,815 likes · top 96%

string · stack

⊣ practice⊣ open on leetcode ↗

Description

Given a valid parentheses string s, return the nesting depth of s. The nesting depth is the maximum number of nested parentheses.

Solution