← All problemsSign in

Sereja and Two Strings 2

CodeChefRating 2296Open on judge ↗

Sereja has a string A consisting of n lower case English letters. Sereja calls two strings X and Y each of length n similar if they can be made equal by applying the following operation at most once in each of them. - Chose any two position i, j in the string (i can be equal to j too). Swap the characters at position i with character at position j. For example strings "abcd" and "acbd" are simi

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