172. Factorial Trailing Zeroes
有5有2才能组成一个0,2的个数比5多,因此主要看有几个5。
class Solution(object):
def trailingZeroes(self, n):
"""
:type n: int
:rtype: int
"""
res = 0
while n:
res += n//5
n = n//5
return res