nums may contain repeated values. Return every different ordering, listed in dictionary order. For [1, 1, 2]: [1,1,2], [1,2,1], [2,1,1].
Example 1
Input:
unique_permutations([1, 1, 2])
Output:
[[1, 1, 2], [1, 2, 1], [2, 1, 1]]
Example 2
Input:
unique_permutations([3, 3])
Output:
[[3, 3]]
0 <= len(nums) <= 8-100 <= nums[i] <= 100No results yet
Run your code to check it against the examples, or submit to run every test.