mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-06 01:15:57 +08:00
11 lines
192 B
Go
11 lines
192 B
Go
package leetcode
|
|
|
|
func getRow(rowIndex int) []int {
|
|
row := make([]int, rowIndex+1)
|
|
row[0] = 1
|
|
for i := 1; i <= rowIndex; i++ {
|
|
row[i] = row[i-1] * (rowIndex - i + 1) / i
|
|
}
|
|
return row
|
|
}
|