Python backtracking (general approach) beats 100%
python\ndef backtrack(nums, res, temp, start):\n    res.append(temp)\n    for i in range(start, len(nums)):\n\t\t# Skip duplicate numbers\n        if not (i > s
```python\ndef backtrack(nums, res, temp, start):\n    res.append(temp)\n    for i in range(start, len(nums)):\n\t\t# Skip duplicate numbers\n        if not (i > start and nums[i-1] == nums[i]):\n            backtrack(nums, res, temp + [nums[i]], i+1)\n\nclass Solution(object):\n    def subsetsWithDup(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: List[List[int]]\n        """\n        nums.sort()\n        res = []\n        backtrack(nums, res, [], 0)\n        return res\n```\n\t\nSimilar approach can be applied to the below and other problems:\n\n* https://leetcode.com/problems/subsets/\n* https://leetcode.com/problems/subsets-ii/\n* https://leetcode.com/problems/combinations/\n* https://leetcode.com/problems/permutations/\n* https://leetcode.com/problems/permutations-ii/\n* https://leetcode.com/problems/combination-sum/\n* https://leetcode.com/problems/combination-sum-ii/\n* https://leetcode.com/problems/palindrome-partitioning/
[]