```
class Solution(object):
def __init__(self):
self.res = []
def dfs(self,nums,path):
if not nums:
self.res.append(path)
for i in range(len(nums)):
if i != 0 and nums[i] == nums[i-1]:
continue
self.dfs(nums[:i]+nums[i+1:],path+[nums[i]])
def permuteUnique(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
nums.sort()
self.dfs(nums,[])
return self.res
```