leetle

Daily challenge for 2026-02-07

403. Simple Bracket Sequence Depth

Given a string $S$ consisting only of opening '(' and closing ')' parentheses, find the maximum nesting depth of the parentheses. The depth is the maximum number of open brackets encountered before a matching closing bracket is found. Assume the input string is a valid sequence (i.e., it is balanced).

Example:
Input: "()(())"
Output: 2

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