Simple Python Solution


  • 0
    Y
    class Solution(object):
        def getRow(self, rowIndex):
            result = [0]*(rowIndex+1)
            result[0] = 1
            for i in range(1,rowIndex+1):
                for j in reversed(range(1,i+1)):
                    result[j]+=result[j-1]
            return result

Log in to reply
 

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