Guest User

Untitled

a guest
Apr 26th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. package main
  2. import "github.com/kr/pretty"
  3.  
  4. func uniquePaths(m int, n int) int {
  5. res := 1
  6. if m > n {
  7. m, n = n, m
  8. }
  9. for i, j := n + 1, 1 ; i <= m + n ; i, j = i + 1, j + 1 {
  10. res *= i
  11. res /= j
  12. }
  13. return res
  14. }
  15.  
  16. func main() {
  17. pretty.Println(uniquePaths(100, 100))
  18. }
Add Comment
Please, Sign In to add comment