1111. Maximum Nesting Depth of Two Valid Parentheses Strings
A string is a valid parentheses string (denoted VPS) if and only if it consists of "(" and ")" characters only, and: - It is the empty string, or - It can be written as AB (A concatenated with B), where A and B are VPS's, or - It can be written as (A), where A is a VPS. We can similarly define the nesting depth depth(S) of any VPS S as follows: - depth("") = 0 - depth(A + B) = max(depth(A),
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start