← All problemsSign in

Chef and Citizenship

On the new planet there is a test before you become the citizen of that planet. Now, since Chef wants the citizenship he has to clear the test. In the test, there is a problem which he couldn't solve. Its your job to help Chef in solving the problem. The problem is as follows: You are given a bracket sequence $S$ consisting of $N$ opening-brackets '(' and closing-brackets ')'. A *regular* bracke

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start