Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def subsets(self, nums: List[int]) -> List[List[int]]:
- ans=self.helper(nums,0,[],[])
- return ans
- def helper(self,input_chars,index,result,curr_soln):
- if index==len(input_chars):
- #print(curr_soln)
- result.append(curr_soln.copy())
- return
- self.helper(input_chars,index+1,result,curr_soln)
- curr_soln.append(input_chars[index])
- self.helper(input_chars,index+1,result,curr_soln)
- curr_soln.pop()
- return result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement