Sorted Unique Permutation Leetcode Solution Extension