solve permutations 2