172-Factorial-Trailing-Zeroes

Sat 17 May 2025

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

import pyutil as pyu
pyu.get_local_pyinfo()
print(pyu.ps2("python-dotenv"))
from typing import List
class Solution:
  def trailingZeroes(self, n: int) -> int:
    return 0 if n == 0 else n // 5 + self.trailingZeroes(n // 5)
new Solution().trailingZeroes()

Score: 5

Category: leetcode