add solution for permutation 2.