Pascal's Triangle II
ID: 119; easy
Solution 1
func getRow(rowIndex int) []int {
res := make([]int, rowIndex + 1)
res[0] = 1
for i := 1; i < rowIndex+1; i++ {
res[i] = res[i-1] * (rowIndex-i+1) / i
}
return res
}Last updated
Was this helpful?