```
class Solution:
# @return a list of integers
def getRow(self, rowIndex):
s = []
for i in range(rowIndex+1):
s.append([])
for j in range(i+1):
if j == 0 or i == 0:
s[i].append(1)
elif j == i:
s[i].append(1)
else:
s[i].append(s[i-1][j-1]+s[i-1][j])
return s[rowIndex]
```