Next Permutation Leetcode Solution In C