Factorial Trailing Zeroes Problem

Factorial Trailing Zeroes Problem — ExecCode Medium DSA Practice

Solve the Factorial Trailing Zeroes problem on ExecCode. Free online medium DSA practice in Arrays - Basics. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Given an integer n, return the number of trailing zeroes in n!. Note that trailing zeroes come from factors of 10 = 2×5; the count is limited by factors of 5.

Examples

Input n = 25; Output 6

Constraints

0 ≤ n ≤ 10^4

Practice Factorial Trailing Zeroes free on ExecCode. Browse DSA problems, topic map, and placement guides.