leetle

Daily challenge for 2025-12-22

356. Balanced Parentheses Depth Check

Given a string s consisting only of opening '(' and closing ')' parentheses, use a stack-based approach to determine the maximum nesting depth of the parentheses. The input string is guaranteed to be a valid sequence of parentheses (i.e., it is balanced). For example, "(()(()))" has a maximum depth of 3.

Input: s = "(()(()))"
Output: 3

Run this challenge interactively in Python or JavaScript when the app loads.