bugfree Icon
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course

Leetcode Problem 172. Factorial Trailing Zeroes

172. Factorial Trailing Zeroes

Leetcode Solutions

Counting Factors of Efficiently

  1. Initialize zeroCount to 0.
  2. While n is greater than 0: a. Divide n by 5 and assign the result back to n. b. Add the result of the division to zeroCount.
  3. Return zeroCount as the number of trailing zeroes in n!.
UML Thumbnail

Counting Factors of

Ask Question

Programming Language
image/screenshot of info(optional)
Full Screen
Loading...

Suggested Answer

Answer
Full Screen
Copy Answer Code
Loading...