← All problemsSign in

Problem 3

Kevin has a string S of length N, but he doesn't like it. In order to create a string which he likes more, he can cut K characters out of this string and insert these characters in the same places from which they were cut out (possibly in a different order). Let's have string abacbca and cut characters at positions 2, 4 and 5. We will get the string a_a__ca and characters 'b' , 'c' and 'b'. One o

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