Python Backtracking Solution
Using sorting and comparison to prevent duplicates. \n\nclass Solution:\n    def subsetsWithDup(self, nums: List[int]) -> List[List[int]]:\n        nums.sort()\
Using sorting and comparison to prevent duplicates. \n```\nclass Solution:\n    def subsetsWithDup(self, nums: List[int]) -> List[List[int]]:\n        nums.sort()\n        self.res = []\n        self.backtrack(nums, [], 0)\n        return self.res\n    \n    def backtrack(self, nums, current, start):\n        self.res.append(current)\n        if start > len(nums):\n            return\n        for i in range(start, len(nums)):\n            if i > start and nums[i-1] == nums[i]:\n                continue\n            self.backtrack(nums, current + [nums[i]], i + 1)\n```\nRuntime: 32 ms, faster than 92.15% of Python3 online submissions for Subsets II.\nMemory Usage: 13.9 MB, less than 84.06% of Python3 online submissions for Subsets II.\n
['Backtracking', 'Python3']