Next Permutation Leetcode Problem