My Python Solution

  • 0
     def subsets(self, nums):      
           if nums is None:      
                 return None
           Next = []
           subsets = [[]]
           for element in nums:
               for List in subsets:
                     Next.append(List + [element])
           subsets += Next
           Next = []
           return subsets

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.