Reversal sort for unsigned permutations

Sign in to test your solution.