backtrace common approach

1
2
3
4
5
6
7
8
9
10
def (nums):
res = []
self.helper([],nums,0,res)
return res
def helper(self,current,nums,index,res):
if condition:
continue
res.append(current)
for i in range(index,len(nums)):
self.helper(current+[nums[i]],nums,index+1,res)