Loading...
Given an integer n, return the number of trailing zeros in n! (the factorial of n) when written in base 10.
n
n!
Input: n = 20 Output: 4 Explanation: 20! = 2432902008176640000, which ends in four zeros.
Input: n = 3 Output: 0 Explanation: 3! = 6 has no trailing zeros.
Click "Run" to test with sample cases or "Submit" to run all tests.