Showing:
Handle Score
@Ibrahim Nash 5761
@akhayrutdinov 5111
@mb1973 4989
@Quandray 4944
@saiujwal13083 4506
@sanjay05 3762
@marius_valentin_dragoi 3516
@sushant_a 3459
@verma_ji 3341
@KshamaGupta 3318
Trailing zeroes in factorial
Easy Accuracy: 46.42% Submissions: 56 Points: 2

For an integer N find the number of trailing zeroes in N!.

Example 1:

Input:
N = 5

Output:
1

Explanation:
5! = 120 so the number of trailing zero is 1.

Example 2:

Input:
N = 4

Output:
0

Explanation:
4! = 24 so the number of trailing zero is 0.

You don't need to read input or print anything. Your task is to complete the function trailingZeroes() which take an integer N as an input parameter and returns the count of trailing zeroes in the N!.

Expected Time Complexity: O(LogN)
Expected Auxiliary Space: O(1)

Constraints:
1 <= N <= 106