172. Factorial Trailing Zeroes

Description

Given an integer n, return the number of trailing zeroes in n!.

Could you write a solution that works in logarithmic time complexity?

Constraints

  • 1 <= n <= 104

Approach

Examples

Input: n = 3

Output: 0

Explanation: 3! = 6, no trailing zero.

Solutions

Follow up

Last updated

Was this helpful?