add solution for next permutation