Skip to content

Practice Preimage Size of Factorial Zeroes Function

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Hard#793
LeetCode Problem

Preimage Size of Factorial Zeroes Function

Problem Statement

Let f(x) be the number of zeroes at the end of x!. Recall that x! = 1 * 2 * 3 * ... * x and by convention, 0! = 1. Given an integer k, return the number of non-negative integers x have the property that f(x) = k.

Source: Preimage Size of Factorial Zeroes Function on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
k = 0
Output
5

# Example 2

Input
k = 5
Output
0

# Example 3

Input
k = 3
Output
5

Constraints

0 <= k <= 10^9

Related LeetCode Problems

Practice more problems similar to Preimage Size of Factorial Zeroes Function.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.