update solution for Leetcode Next Permutation