Sorted Unique Permutation Leetcode Solution In C