permutation recursion solution