```
class Solution(object):
def getRow(self, rowIndex):
result = [0]*(rowIndex+1)
result[0] = 1
for i in range(1,rowIndex+1):
for j in reversed(range(1,i+1)):
result[j]+=result[j-1]
return result
```