update solution to Next Permutation