Please enter your email address or userHandle.
Given a number n. The task is to find the smallest number whose factorial contains at least n trailing zeroes.
n = 1
Explanation : 5! = 120 which has at
least 1 trailing 0.
n = 6
Explanation : 25! has at least
6 trailing 0.
Complete the function findNum() which takes an integer N as input parameters, and returns the answer.
Expected Time Complexity: O(log2 N * log5 N).
Expected Auxiliary Space: O(1).
1 <= n <= 104
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Login to access your submissions.
Please choose 'ReadOnlyMode' if you needn't to 'Edit' the problem e.g. viewing OJ's solution, TestCase Files (TCFs), TimeLimit etc.