Skip to content

Instantly share code, notes, and snippets.

@staticor
Created October 17, 2019 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save staticor/2f4d6d27eee522e53780b939ad28b845 to your computer and use it in GitHub Desktop.
Save staticor/2f4d6d27eee522e53780b939ad28b845 to your computer and use it in GitHub Desktop.
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