Factorial Trailing Zeroes

Medium · Math & Number Theory · about 10 minutes

Asked at Google, Amazon, Microsoft, Bloomberg.

How many zeros does n! end with? Find it in time logarithmic in n.