Trailing Zeros in Factorial Problem

Trailing Zeros in Factorial Problem — ExecCode School DSA Practice

Solve the Trailing Zeros in Factorial problem on ExecCode. Free online school DSA practice in Math. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Given a non-negative integer n, return the factorial of n. Factorial of n (n!) is the product of all positive integers less than or equal to n. Example: 3! = 3 2 1 = 6

Examples

Input n = 3; Output 6. Input n = 0; Output 1. Input n = 5; Output 120

Constraints

0 <= n <= 12 n is an integer

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