← All problemsSign in

Aabra Ka Daabra

Alex is super excited for his first class in the school of Magic. On the first day of class, the students were given a string S of length L containing lowercase letters 'a' and 'b' only. The wizard casts the famous "Aabra Ka Daabra" spell and asked them to find the length of the reduced string. This spell removes the "ab" substring from the string whenever it encounters it. Help Alex in finding

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