python leetcode 172. Factorial Trailing Zeroes

考察一个数学公式

class Solution:
    def trailingZeroes(self, n):
        """
        :type n: int
        :rtype: int
        """
        res=0
        while n:
            res+=n//5
            n=n//5
        return res

猜你喜欢

转载自blog.csdn.net/Neekity/article/details/85013312
今日推荐