add new solutions
This commit is contained in:
parent
886b5e0a8e
commit
67cad91898
47 changed files with 1549 additions and 1 deletions
15
solutions/0/q62/solution.go
Normal file
15
solutions/0/q62/solution.go
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue