class Solution {
public:
int uniquePaths(int m, int n) {
long long ret(1);
int i(0);
if(m<n) swap(m,n);
--n;
for(m;i<n;++i,++m)
{
ret*=m;
}
while(n>1)
{
ret/=n--;
}
return (int)ret;
}
};
leetcode - 62. Unique Paths
最新推荐文章于 2020-07-06 10:02:06 发布