Simple Python Solution


  • 0
    B
    import math
    class Solution(object):
    def getRow(self, rowIndex):
        """
        :type rowIndex: int
        :rtype: List[int]
        """
        lists = []
        for i in xrange(rowIndex+1):
            lists.append(math.factorial(rowIndex)/(math.factorial(i)*math.factorial(rowIndex-i)))
        return lists

Log in to reply
 

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