My Python Solution


  • 0
    L
     def subsets(self, nums):      
           if nums is None:      
                 return None
           Next = []
           subsets = [[]]
           nums.sort()
        
           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.