Domanda di colloquio di Blueshift

the question was about string permutation