Leetcode172. Factorial Trailing Zeroes
题目
Given an integer n, return the number of trailing zeroes in n!.Note: Your solution should be in logarithmic time complexity.
思路
给出一个整数n,计算n的阶乘的结果,有多少个0
如果计算阶乘,然后再计算结果中有多少个0时,容易造成数据过大溢出;可以换个角度考虑,
原创
2016-11-30 16:58:55 ·
160 阅读 ·
0 评论