class Solution:
    def generate(self, numRows: int) -> List[List[int]]:
        res=[[] for i in range(numRows)]
        for i in range(numRows):
            temp=[1]*(i+1)
            for j in range(1,i):
                temp[j]=res[i-1][j-1]+res[i-1][j]
            res[i]=temp
        return res
