We’re preparing your current view and syncing the latest data.
Given a collection of numbers, nums, that might contain duplicates, return all possible unique permutations in any order.
The input is a list of integers nums, which may contain duplicate elements.
Return a list of lists, where each inner list is a unique permutation of the input list.
1 <= nums.length <= 8 -10 <= nums[i] <= 10
Example 1
Input
[1,1,2]
Output
[[1,1,2],[1,2,1],[2,1,1]]
Explanation
All unique permutations of [1,1,2] are returned without duplicates.