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
猜你喜欢
转载自blog.csdn.net/weixin_41938758/article/details/89075508
今日推荐
周排行