class Solution {
public:
int trailingZeroes(int n) {
if(n<=4){
return 0;
}
int currAns, ans = 0;
do{
ans += currAns = n / 5;
n /= 5;
}while(currAns);
return ans;
}
};
Leetcode Factorial Trailing Zeroes
最新推荐文章于 2019-03-01 20:39:05 发布