Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Leetcode一些编程小练习
class Solution:
def getRow(self, rowIndex: int) -> List[int]:
if rowIndex < 0:
return []
ans = [1]*(rowIndex+1)
for i in range(rowIndex):
ans[i+1] = ans[i]*(rowIndex-i)//(i+1)
return ans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment