上一页 1 ··· 13 14 15 16 17
摘要: 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 阅读全文
posted @ 2018-05-01 23:33 JTechRoad 阅读(419) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/largest-number-at-least-twice-of-others/description/ 阅读全文
posted @ 2018-05-01 12:42 JTechRoad 阅读(109) 评论(0) 推荐(0) 编辑
摘要: When to use binary search: * 我们知道解空间在一个区间 [i,j] * valid解是解空间的一个点(也可以看作是只有一个点的range)或者一个range的起始点或者结束点 * range之外的点都不是valid解 想法一般都两种: * 直接找到解 (比如classic 阅读全文
posted @ 2018-05-01 08:32 JTechRoad 阅读(204) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: // O(n) // The idea is to maintain a window for all chars seen so far. // For [1,0,2,3,4], i = 0, we know the window should at least end on pos[i=0]=1. // For... 阅读全文
posted @ 2018-04-30 15:20 JTechRoad 阅读(128) 评论(0) 推荐(0) 编辑
摘要: https://www.programcreek.com/2013/08/leetcode-problem-classification/ https://medium.com/algorithms-and-leetcode https://medium.com/@sourabreddy 阅读全文
posted @ 2018-04-30 15:18 JTechRoad 阅读(90) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17