```
class Solution:
# @param {integer[]} nums
# @return {integer[][]}
def permuteUnique(self, nums):
if len(nums)<2:
return [nums]
pre ='a'
result =[]
nums.sort()
for i in range(len(nums)):
if nums[i]!=pre:
for y in self.permuteUnique(nums[:i]+nums[i+1:]):
result.append([nums[i]]+y)
pre = nums[i]
return result
```