Data Structure & Algorithm: Level-1 Problem #26. Trailing Zeroes

Given a integer N, find out how many trailing zeroes are there for it’s factorial result – N!.

Sample Input: 10!

Sample Output: 2

The factorial of 10 is 3628800, so the trailing zeroes are two.


数据结构和算法:初级练习题 #26 – 尾随零


给定一个整数,计算它的阶乘结果有多少个尾随零。

输入样例: 10!

输出样例: 2

10的阶乘结果是 3628800,所以尾随零的个数是 2。


Python Solution

Trailing Zeroes