254. Drop Eggs https://www.lintcode.com/problem/drop-eggs/description?_from=ladder&&fromId=1 28. Search a 2D Matrix https://www.lintcode.com/problem/s ...
分类:
其他好文 时间:
2019-04-19 09:13:25
阅读次数:
182
3.统计数字(Digit Count) 计算数字 k 在 0 到 n 中的出现的次数,k 可能是 0~9 的一个值。 首先是,惯用思维,2个循环解决,这样做的时间复杂度为O(n*2) 提交成功后,看到讨论区有时间复杂度为O(log(n))的解法,搞懂思路后,终于自己实现了 本题求k出现的次数,其实可 ...
分类:
编程语言 时间:
2019-02-24 00:23:32
阅读次数:
249
3.统计数字 计算数字 k 在 0 到 n 中的出现的次数,k 可能是 0~9 的一个值。 class Solution: """ @param k: An integer @param n: An integer @return: An integer denote the count of di ...
分类:
其他好文 时间:
2019-02-22 21:24:00
阅读次数:
201
"124. Longest Consecutive Sequence" / "128. Longest Consecutive Sequence" 本题难度: Medium/Hard Topic: Data Structure Description Given an unsorted array ...
分类:
其他好文 时间:
2019-02-17 15:31:49
阅读次数:
223
"15. Permutations" / "46. Permutations" 本题难度: Medium Topic: Search & Recursion Description Given a list of numbers, return all possible permutations. ...
分类:
其他好文 时间:
2019-02-16 09:27:35
阅读次数:
173
"16. Permutations II" / "47. Permutations II" 本题难度: Medium Topic: Search & Recursion Description Given a list of numbers with duplicate number in it. ...
分类:
其他好文 时间:
2019-02-16 09:25:50
阅读次数:
170
"33. N Queens" / "51. N Queens" 本题难度: Medium/Hard Topic: Search & Recursion Description The n queens puzzle is the problem of placing n queens on an n ...
分类:
其他好文 时间:
2019-02-15 22:26:06
阅读次数:
236
"152. Combinations" / "77. Combinations" 本题难度: Medium Topic: Search & Recursion Description Given two integers n and k, return all possible combinatio ...
分类:
其他好文 时间:
2019-02-15 01:11:29
阅读次数:
181
"7. Serialize and Deserialize Binary Tree" / "297. Serialize and Deserialize Binary Tree" 本题难度: Medium/Hard Topic: Binary Tree Description Design an a ...
分类:
其他好文 时间:
2019-02-14 23:57:27
阅读次数:
302
"95. Validate Binary Search Tree" / "98. Validate Binary Search Tree" 本题难度: Easy Topic: Binary Tree Description Given a binary tree, determine if it i ...
分类:
其他好文 时间:
2019-02-14 22:12:44
阅读次数:
199