```
class Solution:
# @param {integer} rowIndex
# @return {integer[]}
def getRow(self, rowIndex):
res = []
for i in range(rowIndex+1):
res.append(1)
#range(start,end,step)
for j in range(i,0,-1):
if j==i:
res[j]=1
else:
res[j] += res[j-1]
return res
```