793. Preimage Size of Factorial Zeroes Function Hard
1/**
2 * [793] Preimage Size of Factorial Zeroes Function
3 *
4 * 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.
5 *
6 * For example, f(3) = 0 because 3! = 6 has no zeroes at the end, while f(11) = 2 because 11! = 39916800 has two zeroes at the end.
7 *
8 * Given an integer k, return the number of non-negative integers x have the property that f(x) = k.
9 *
10 * Example 1:
11 *
12 * Input: k = 0
13 * Output: 5
14 * Explanation: 0!, 1!, 2!, 3!, and 4! end with k = 0 zeroes.
15 *
16 * Example 2:
17 *
18 * Input: k = 5
19 * Output: 0
20 * Explanation: There is no x such that x! ends in k = 5 zeroes.
21 *
22 * Example 3:
23 *
24 * Input: k = 3
25 * Output: 5
26 *
27 *
28 * Constraints:
29 *
30 * 0 <= k <= 10^9
31 *
32 */
33pub struct Solution {}
34
35// problem: https://leetcode.com/problems/preimage-size-of-factorial-zeroes-function/
36// discuss: https://leetcode.com/problems/preimage-size-of-factorial-zeroes-function/discuss/?currentPage=1&orderBy=most_votes&query=
37
38// submission codes start here
39
40impl Solution {
41 pub fn preimage_size_fzf(k: i32) -> i32 {
42 0
43 }
44}
45
46// submission codes end
47
48#[cfg(test)]
49mod tests {
50 use super::*;
51
52 #[test]
53 fn test_793() {
54 }
55}
56
Back
© 2025 bowen.ge All Rights Reserved.