← All problemsSign in

Play With Strings

You are given a string $s$ of length $N$ and three values $A,B,C$. The numeric of a character is defined as (index in English Alphabet)%3 (For eg. 0 for 'a', 1 for 'b' , 2 for 'c' , 0 for 'd' .....). Now you have to assign $A,B,C$ to each of the three possible numeric i.e. $0,1,2$ in any random order, such that each $A,B,C$ is assigned to exactly one of the numeric and at least one value from $A

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