← All problemsSign in

Longest non regular parentheses sub-sequence

CodeChefRating 2187Open on judge ↗

Chef has recently learnt about sequences of parentheses. These are special sequences that contain only the characters '(' and ')'. A regular parentheses sequence follows the following definition: - An empty sequence is regular - If S is a regular sequence, then (S) is also regular - If A and B represent two regular sequences, then their concatenation AB is also regular. Therefore, the sequenc

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