1 Star 0 Fork 2

coderush / beating-interviewer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
不同路径.java 434 Bytes
一键复制 编辑 原始数据 按行查看 历史
coderush 提交于 2022-08-06 01:41 . [吴峻申] #N/A 新特性:不同路径
package com.wujunshen.algorithm.leetcode.dynamic.programming;
/**
* @author frank woo(吴峻申) <br>
* email:<a href="mailto:frank_wjs@hotmail.com">frank_wjs@hotmail.com</a> <br>
* @date 2022/8/6 01:35<br>
*/
public class 不同路径 {
public int uniquePaths(int m, int n) {
long ans = 1L;
for (int x = n, y = 1; y < m; ++x, ++y) {
ans = ans * x / y;
}
return (int) ans;
}
}
Java
1
https://gitee.com/darkranger/beating-interviewer.git
git@gitee.com:darkranger/beating-interviewer.git
darkranger
beating-interviewer
beating-interviewer
master

搜索帮助