← All problemsSign in

Little Elephant and Swapping

CodeChefRating 2285Open on judge ↗

A Little Elephant from the Zoo of Lviv likes lucky strings, i.e., the strings that consist only of the lucky digits 4 and 7. He is now studying some special transformation defined on the set of the lucky strings. The lucky string T is called a swap permutation of the lucky string S with |S| = N if it can be derived from S by the following process. - Choose some integers L and R such that 1 ≤ L ≤

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