Trailing Zeroes in Factorial
Return how many zeros the number n! (n factorial, 1 * 2 * ... * n) ends with. Aim to do it without computing the factorial.
Example 1
n 5
returns 1
5! = 120, one trailing zero.
Example 2
n 10
returns 2
10! = 3628800, two trailing zeros.
Constraints
0 <= n <= 1000
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.