solve permutations ii