Skip to content

Instantly share code, notes, and snippets.

@Ray1988
Created May 31, 2014 20:05
Show Gist options
  • Save Ray1988/232ea516d750db3516ef to your computer and use it in GitHub Desktop.
Save Ray1988/232ea516d750db3516ef to your computer and use it in GitHub Desktop.
Python
class Solution:
# @return a list of integers
def getRow(self, rowIndex):
if rowIndex<0:
return None
result=[0]*(rowIndex+1)
result[0]=1
for i in range(1,len(result)):
result[i]=1
for j in range(i-1, 0, -1):
result[j]=result[j]+result[j-1]
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment