Pascal's Triangle II
Solution Code
from typing import Listclass Solution:def getRow(self, rowIndex: int) -> List[int]:row = [1] * (rowIndex + 1)for i in range(1, rowIndex + 1):for j in range(i - 1, 0, -1):row[j] = row[j] + row[j - 1]return rowTime Complexity
O(k^2) where k is rowIndex
Space Complexity
O(k) to store the output row

