Created
October 17, 2019 23:37
-
-
Save staticor/2f4d6d27eee522e53780b939ad28b845 to your computer and use it in GitHub Desktop.
Leetcode一些编程小练习
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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