172.Factorial Trailing Zeroes

 

 

class Solution:
    def trailingZeroes(self, n: int) -> int:
        if n < 5:
            return 0
        return n//5 + self.trailingZeroes(n//5)

 

posted @ 2020-05-09 14:49  星海寻梦233  阅读(55)  评论(0编辑  收藏  举报