16 lines
282 B
Go
16 lines
282 B
Go
// Package q62 implements a solution for https://leetcode.com/problems/unique-paths/
|
|
package q62
|
|
|
|
func uniquePaths(m int, n int) int {
|
|
buf := make([]int, n)
|
|
buf[0] = 1
|
|
|
|
for range m {
|
|
for c := 1; c < n; c++ {
|
|
buf[c] += buf[c-1]
|
|
}
|
|
}
|
|
return buf[n-1]
|
|
}
|
|
|
|
var _ = uniquePaths
|