Skip to content

Bug Report for subsets-ii #4762

@temnikovd

Description

@temnikovd

Bug Report for https://neetcode.io/problems/subsets-ii

Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.

The following code is not running

Tried the same in leetcode and it was accepted

`class Solution:
def subsetsWithDup(self, nums: List[int]) -> List[List[int]]:
res = set()
nums.sort()

    cur = []
    def subsets(i, cur):
        if i == len(nums):
            res.add(tuple(cur))
            return
        cur.append(nums[i])
        subsets(i+1, cur)
        cur.pop()
        subsets(i+1, cur)
    
    subsets(0, [])
    return list(res)`
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions