摘要:
https://leetcode.com/problems/can-place-flowers/description/ First version: V2: 阅读全文
摘要:
https://leetcode.com/problems/network-delay-time/description/, we need to go to every node from K, calculate the max weight. Dijkstra: BFS: Bellman Fo 阅读全文
摘要:
DFS: Topological sort: 阅读全文
摘要:
https://leetcode.com/problems/course-schedule/description/ DFS, detect cycle. For each node, we have 3 states during DFS: 1) un-visited, 2) visiting, 阅读全文
摘要:
https://leetcode.com/problems/course-schedule-ii/description/ DFS: 阅读全文
摘要:
https://leetcode.com/problems/random-pick-index/description/ Reservoir Sampling 阅读全文
摘要:
https://leetcode.com/problems/daily-temperatures/description/ 阅读全文
摘要:
https://leetcode.com/problems/k-th-symbol-in-grammar/description/ 阅读全文
摘要:
https://leetcode.com/problems/partition-to-k-equal-sum-subsets/description/ Use DFS. We need to choose k group of numbers (each group sum to s). The s 阅读全文
摘要:
https://leetcode.com/problems/minimum-distance-between-bst-nodes/description/ 阅读全文