add solution for permutation problem