Next Permutation Leetcode Solution 331