![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Math
再见小小ronnie
这个作者很懒,什么都没留下…
展开
-
Leetcode 453. Minimum Moves to Equal Array Elements
/** * sum is the sum of the array, min is the minimum of the array, f is the final value of the m moves * m is # of moves, n is the size of the array * sum + m(n-1) = f*n (1) * min + m = f转载 2017-01-29 09:37:03 · 204 阅读 · 0 评论 -
Leetcode 263. Ugly Number
Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. Which means an ugly number is 2^i * 3^j * 5^k * 1 (i,j,k are non-negative integers). Therefore, we can keep dividing the g原创 2017-03-08 12:08:40 · 164 阅读 · 0 评论 -
Leetcode 264. Ugly Number II
An approach is to check every number if it is an ugly number, until we meet the nth ugly number. An efficient way is to construct and enumerate all n ugly number and return the last one. public clas原创 2017-03-10 02:19:46 · 162 阅读 · 0 评论