Challenge: Max Depth Parenthesis

Let’s learn how to find the depth of parentheses in a valid sequence of parentheses.

Problem statement

Given a balanced parentheses expression, find the maximum depth of the parentheses. For example, in () the maximum depth is 1 and in ((()))() the maximum depth is 3.

Get hands-on with 1400+ tech skills courses.