Problem
Return how many trailing zeros n! has (n! = n · (n - 1) · ... · 2 · 1). Can you do it in logarithmic time, without computing the factorial?
Example 1
- Input
- n = 3
- Output
- 0
- Why
- 3! = 6
Example 2
- Input
- n = 5
- Output
- 1
- Why
- 5! = 120
Example 3
- Input
- n = 25
- Output
- 6
Constraints
0 <= n <= 10^4