← All problemsSign in

Alternative string

Problem description. A String always consists of two distinct alternating characters. For example, if string 's two distinct characters are x and y, then it could be xyxyx or yxyxy but not xxyy or xyyx. You can convert some string to the string format specified above by deleting characters from the string. When you delete a character from the string, you must delete all occurrences of it in the

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