A number theorist counts how many zeroes appear at the end of n! without computing it.
Task: Count trailing decimal zeroes in n factorial.
Input format: One nonnegative integer n.
Output format: Print the number of trailing zeroes in n!.
Constraints: 0 <= n <= 10^18
Example 1:
Input: 0
Output: 0
Example 2:
Input: 5
Output: 1
Example 3:
Input: 10
Output: 2
Constraints:
0 <= n <= 10^18
Tags:
factorial loops number-properties
Loading...
Test Cases:No test cases
No test cases available.
Zeros at the End of the Factorial - EASY Coding Problem | CodeTikki