随笔分类 - Leetcode
摘要:https://leetcode.com/problems/most-profit-assigning-work/description/
阅读全文
摘要:https://leetcode.com/submissions/detail/153740275/class Solution { public: int fourSumCount(vector& A, vector& B, vector& C, vector& D) { unordered_map CD_freq; for (auto i : C) ...
阅读全文
摘要:https://leetcode.com/problems/path-sum-iii/description/
阅读全文
摘要:https://leetcode.com/problems/partition-equal-subset-sum/description/
阅读全文
摘要:https://leetcode.com/problems/pacific-atlantic-water-flow/description/
阅读全文
摘要: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
阅读全文
摘要: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/
阅读全文
摘要:https://leetcode.com/problems/accounts-merge/description/
阅读全文
摘要:https://leetcode.com/problems/friend-circles/description/
阅读全文
摘要:https://leetcode.com/problems/number-of-islands/description/
阅读全文
摘要:https://leetcode.com/problems/redundant-connection/description/ Use map to do Union Find.
阅读全文
摘要:https://leetcode.com/problems/sort-characters-by-frequency/description/
阅读全文
摘要:https://leetcode.com/problems/non-overlapping-intervals/description/ Greedy. Sort by (start,-end). Scan from left to right, if we see 2 intervals over
阅读全文
浙公网安备 33010602011771号