Python solution using zip


  • 0
    R
        def getRow(rowIndex):
            row = [1]
            for _ in xrange(rowIndex):
                row = [l + r for (l, r) in zip([0] + row, row + [0])]
            return row
    

Log in to reply
 

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