Update pascal_triangle.py

This commit is contained in:
marina 2023-08-07 17:08:53 -07:00 committed by GitHub
parent 9a820d8599
commit 3d8721aaeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,11 +3,11 @@
# author: bt3gl
def get_row(self, irow: int) -> list[int]:
def get_row(self, row: int) -> list[int]:
if irow == 0:
if row == 0:
return [1]
result = self.get_row(irow - 1)
result = self.get_row(row - 1)
return [1] + [sum(_) for _ in zip(result, result[1:])] + [1]