Python

```
def getRow(self, rowIndex):
r = [1]
for i in xrange(1,rowIndex+1):
r.append( r[-1]*(rowIndex-i+1)/i )
return r
```

which can be translated to one line solution

```
def getRow1(self, rowIndex):
return reduce(lambda lst,i: lst + [lst[-1]*(rowIndex-i+1)/i], [[1]] + range(1,rowIndex+1))
```