leetcode Factorial Trailing Zeroes
2015-12-01 20:23
519 查看
没什么意思的题目。
https://leetcode.com/problems/factorial-trailing-zeroes/
参考:
http://bookshadow.com/weblog/2014/12/30/leetcode-factorial-trailing-zeroes/
自己的code,效率低。
my code:
https://leetcode.com/problems/factorial-trailing-zeroes/
参考:
http://bookshadow.com/weblog/2014/12/30/leetcode-factorial-trailing-zeroes/
自己的code,效率低。
my code:
if n == 0: return 0 def fac(m): if m == 0: return 1 else: return m * fac(m - 1) num = str(fac(n)) i = -1 while num[i] == '0': #print count i -= 1 return len(num[i+1:])
相关文章推荐
- 463B. Caisa and Pylons
- git fatal: Out of memory, malloc failed
- Mathematics:X-factor Chains(POJ 3421)
- Uva 442-Matrix Chain Multiplication (基本栈)
- AI基础中的Minimax及Alpha-beta算法
- 发现大量的TIME_WAIT解决办法
- 小议:SharePoint 2013 Configuration Failed
- Leetcode #217 Contains Duplicate
- Project Euler 92:Square digit chains 平方数字链
- Failed to merge incompatible data types StringType and BinaryType
- \backend\models\core\Email
- Daily Scrum - 12/01
- [LeetCode]Contains Duplicate II
- NSLayoutConstraint 修改xib中view的高度
- RAID10与RAID01比较,RAID10与RAID5比较
- 【LeetCode】70 Climbing Stairs
- 【LeetCode】217 Contains Duplicate
- linker command failed with exit code 1 (use -v to see invocation)问题
- SSKeychain
- RAID详解[RAID0/RAID1/RAID10/RAID5]