Factorial Trailing Zeroes
Problem statement
Given a nonnegative integer n, return the number of trailing zeroes in the decimal representation of n!.
Function
trailingZeroes(n: int) → intExamples
Example 1
n = 5return = 15! = 120, which ends with one zero.
Example 2
n = 30return = 7The factors 5, 10, 15, 20, 25, and 30 contribute six factors of five, and 25 contributes one additional factor.
Constraints
0 <= n <= 10^90! = 1