Given an integer n, return the number of trailing zeroes in n!.
Note:
Your solution should be in logarithmic time complexity.
Solution
n!后缀0的个数 = n!质因子中5的个数
= floor(n/5) + floor(n/25) + floor(n/125) + ....
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|