← All problemsSign in

Chef helping Blob

Blob has been kidnapped and the kidnapper will only let Blob go if he solves the problem given to him. Chef wants to help Blob to survive. He knows that Blob is not smart enough to do so. He has given you the problem and asked you to help him survive. You are given a string of length N represented by S. The string can only contain combination of two characters 'a' and 'b'. The following operation

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