one line Python using recursion


  • 0
    B

    First time contributing my solution!

    return [[],L] if len(L)==1 else [i+j for i in self.subsets(L[1:]) for j in [[], [L[0]]]]
    

Log in to reply
 

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