LeetCode Solution, Medium, 31. Next Permutation