Given an integer n, return the number of trailing zeroes in n!.
Note: Your solution should be in logarithmic time complexity.
结果的末尾有0 说明是2和5相乘的结果
在求阶乘的过程中 有一半带有2 说明2 是有很多的
那么就只用考虑5的个数
public class Solution {
public int trailingZeroes(int n) {
return n == 0 ? 0 : n / 5 + trailingZeroes(n / 5);
}
}