Python 3 solution Kth Row of Pascal's Triangle


#1
class Solution:
# @param A : integer
# @return a list of integers
def getRow(self, k):
    if k is 0:
        return [1]
    elif k is 1:
        return [1,1]
        
    prev = [1,1]
    curr = []
    for i in range(1,k):
        curr = [1]
        for j in range(len(prev)-1):
            curr.append(prev[j] + prev[j+1])
        curr.append(1)
        prev = curr
    return curr