摘要:
https://leetcode.com/problems/cheapest-flights-within-k-stops/description/ DFS (slow) BFS (seems not able to use BFS as below, we may have to record e 阅读全文
摘要:
https://leetcode.com/problems/largest-number-at-least-twice-of-others/description/ 阅读全文
摘要:
When to use binary search: * 我们知道解空间在一个区间 [i,j] * valid解是解空间的一个点(也可以看作是只有一个点的range)或者一个range的起始点或者结束点 * range之外的点都不是valid解 想法一般都两种: * 直接找到解 (比如classic 阅读全文