solved palindrom permutation