The Parenthesis Tree
CodeChefOpen on judge ↗
Samosa Bhai and Jalebi Bai are taking cooking classes from CodeChef. CodeChef, as the name suggests, is also a coding enthusiast. So he decides to get his pupils interested in coding. For this, he takes them both to a strange tree made up of **N** nodes. Each of these nodes is of one of the following two types — nodes containing open parenthesis **(** and nodes containing closed parenthesis **)**
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