Bit Manipulation - Subsets Using Bitmask
In the following backtracking code snippet for subsets, which line causes all subsets in the result to be identical?
def subsets(nums):
res = []
def backtrack(i, path):
res.append(path)
if i == len(nums):
return
backtrack(i + 1, path + [nums[i]])
backtrack(i + 1, path)
backtrack(0, [])
return res