[Python3] backtracking
\nclass Solution:\n    def subsetsWithDup(self, nums: List[int]) -> List[List[int]]:\n        """\n        level0    []\n        level1    [1]          [2] \n  
```\nclass Solution:\n    def subsetsWithDup(self, nums: List[int]) -> List[List[int]]:\n        """\n        level0    []\n        level1    [1]          [2] \n        level2    [1,2]        [2,2]\n        level3    [1,2,2]\n        """\n        nums = sorted(nums)\n        res = []\n        self.backtracking(res,0,[],nums)\n        return res\n    def backtracking(self,res,start,subset,nums):\n        res.append(list(subset))\n        for i in range(start,len(nums)):\n            if i > start and nums[i] == nums[i-1]:\n                continue\n            subset.append(nums[i])\n            self.backtracking(res,i+1,subset,nums)\n            subset.pop()\n```
['Backtracking', 'Python', 'Python3']