1-line Python Solution


  • 2
    D
    class Solution:
        def generate(self, numRows):
            return map(lambda m: reduce(lambda r, n: r + [r[-1] * (m - n) / (n + 1)], xrange(m), [1]), xrange(numRows))
    

    Forgive me if I'm too bored.


Log in to reply
 

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