Given an integer n, return the number of trailing zeroes in n!.
Note: Your solution should be in logarithmic time complexity.
Credits:
Special thanks to for adding this problem and creating all test cases.
to see which companies asked this question
答案解释可以看 陈皓在leetcode Discuss上的答案:
int trailingZeroes(int n) { int result = 0; for (long long i = 5; n / i>0; i *= 5) { result += (n / i); } return result;}