Next Permutation Leetcode Solution 862