5
This commit is contained in:
12
solutions/lc119.py
Normal file
12
solutions/lc119.py
Normal file
@@ -0,0 +1,12 @@
|
||||
class Solution:
|
||||
def getRow(self, rowIndex: int) -> List[int]:
|
||||
row = [1]
|
||||
|
||||
for _ in range(rowIndex):
|
||||
new_row = [1]
|
||||
new_row.extend([row[i]+row[i+1] for i in range(len(row)-1)])
|
||||
new_row.append(1)
|
||||
|
||||
row = new_row
|
||||
|
||||
return row
|
||||
Reference in New Issue
Block a user