Leetcode Next Permutation C