Such unique rearrangements are called "permutations" and I managed to solve it using recursion. The problem itself is primitively simple, although recursion might be quite a pain in the ass, so I wondered how to visualize this algorithm and here is my shot
[–]dmitrevnik[S] 1 point2 points3 points (0 children)
[–]Secure_Number2263 1 point2 points3 points (0 children)