Solving permutations problems. Recursive and all permutation ok