Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class Solution(object):
def subsetsWithDup(self, nums):
:type nums: List[int]
:rtype: List[List[int]]
nums = sorted(nums)
result = []
temp = []
self.backtrack(nums, result, temp, 0)
return result
def backtrack(self, nums, result, temp, start):
for i in range(start, len(nums)):
if i > start and nums[i] == nums[i - 1]: continue
self.backtrack(nums, result, temp, i + 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.