← All problemsSign in

The string game

Alice and Bob are playing a game, Alice picks a string S which is unknown to Bob. Bob asks Alice to run Q queries on the string. There are three possible types of query that Bob can ask for. Following are the description of the queries: - S x: Substitute the character at the first position with x. - D y: Delete all occurrences of character y from the string. - R n: Arrange the first n character

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