One Line Python, Functional


  • 0
    N
    return reduce(lambda l, y: [(x + y if z == 0 else x) for z in xrange(2) for x in l], [[y] for y in nums], [[]])
    

Log in to reply
 

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