算法
JasonChan1024
这个作者很懒,什么都没留下…
展开
-
Digit Counts 问题
Digit CountsDescriptionCount the number of k’s between 0 and n. k can be 0 - 9.Exampleif n = 12, k = 1 in[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]we have FIVE 1’s (1, 10, 11, 12)解题思路从n的个位数数字开始,检查其是否与...原创 2018-03-03 17:30:36 · 271 阅读 · 0 评论 -
Kth Largest Element
DescriptionFind K-th largest element in an array.ExampleIn array [9,3,2,4,8], the 3rd largest element is 4.In array [1,2,3,4,5], the 1st largest element is 5, 2nd largest element is 4, 3rd largest ele...原创 2018-03-19 16:39:01 · 279 阅读 · 0 评论