class Solution: def getRow(self, rowIndex: int) -> List[int]: ans = [1] for i in range(rowIndex + 1): tmp = [1 for i in range(i + 1)] for j in range(1, i): tmp[j] = ans[j-1] + ans[j] ans = tmp return ans
class Solution: def getRow(self, rowIndex: int) -> List[int]: ans = [1] for i in range(rowIndex + 1): tmp = [1 for i in range(i + 1)] for j in range(1, i): tmp[j] = ans[j-1] + ans[j] ans = tmp return ans