Factorial trailing zeroes thing
This commit is contained in:
parent
efc1c8f029
commit
5df7489f27
@ -498,3 +498,14 @@ class Trie:
|
||||
and (current_node.is_leaf or prefix_ok)
|
||||
and current_node.value == word
|
||||
)
|
||||
|
||||
|
||||
def count_factorial_trailing_zeroes(number: int) -> int:
|
||||
divisor: int = 5
|
||||
zeroes_count: int = 0
|
||||
|
||||
while divisor <= number:
|
||||
zeroes_count += number // divisor
|
||||
divisor *= 5
|
||||
|
||||
return zeroes_count
|
||||
|
Loading…
Reference in New Issue
Block a user