Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Count the number 5 solution in Clear category for Factorial Zeros by H0r4c3
def fact_zeros(n: int) -> int:
count = 0
while n > 4:
count += n // 5
n //= 5
return count
print("Example:")
print(fact_zeros(2))
# These "asserts" are used for self-checking
assert fact_zeros(2) == 0
assert fact_zeros(5) == 1
assert fact_zeros(20) == 4
print("The mission is done! Click 'Check Solution' to earn rewards!")
June 1, 2024
Comments: