Counting trailing 0s of n! It is not very hard to figure out how to count it - simply count how many 5s. Since even numbers are always more than 5s, we don‘t have to consider even numbers.
But counting 5, is tricky. Naive method is quite slow - I got 12+s for
1000000000. And after reading below article, I got 0.04s. The former counts
individually, duplicated; but the latter counts smart:
http://en.wikipedia.org/wiki/Trailing_zeros#Factorial