← All problemsSign in

Jon Snow knows nothing

In an epic battle between two lovers Jon Snow and Ygritte, you have been summoned to decide the victor. Ygritte wants to prove in front of entire Westeros that Jon Snow knows nothing. She gives Jon a string S in which she has performed N swaps. Jon has to find the original string and emerge victorious. One swap is performed in this way: - ith letter from the end is placed between ith and (i+1)th

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