Sorted Unique Permutation Leetcode Solution