chenye-814 / DTSTRCT-ALGRTHM

0 stars 0 forks source link

Dec-26 Factorial Trailing Zeroes #4

Open chenye-814 opened 1 year ago

chenye-814 commented 1 year ago

https://leetcode.com/problems/factorial-trailing-zeroes/description/

chenye-814 commented 1 year ago
view code ```py class Solution: def trailingZeroes(self, n: int) -> int: acc, prod = 0, 1 while prod <= n: prod *= 5 acc += n // prod return acc ```