Python Easy & Simple Solution


#1
    class Solution:
# @param A : integer
# @return a list of integers
def getRow(self, A):
    arr = []
    for i in range(A+1):
        tri = []
        for j in range(i+1):
            if j == 0:
                tri.append(1)
            else:
                try:
                    prev = arr[i-1][j] + arr[i-1][j-1]
                    tri.append(prev)
                except:
                    tri.append(1)
        arr.append(tri)
    return arr[A]