成吉思(刷)
Tuesday, March 29, 2016
LeetCode Q172: Factorial Trailing Zeros
Given an integer
n
, return the number of trailing zeroes in
n
!.
Note:
Your solution should be in logarithmic time complexity.
Solution:
Zeros is produced by "5 x even number", so count how many 5s in each number.
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment