Given a number n. The task is to find the smallest number whose factorial contains at least n trailing zeroes.
Example 1
Input: n = 1
Output: 5
Explanation: 5! = 120 which has at least 1 trailing 0.
Example 2
Input: n = 6
Output: 25
Explanation: 25! has at least 6 trailing 0.
Approach, complexity and clean code in every language. Sign in to unlock the editorial.
Your submissions, results and runtime history live here. Sign in to start your streak.
1
5
6
25