Next Permutation Leetcode Solution 9