摘要:
题解 Hard 方法:Trie struct TrieNode { vector<int> indexes; vector<TrieNode*> next; TrieNode() : next(26, nullptr) { } }; class Solution { public: vector<v 阅读全文
摘要:
题解 Medium Heap (Priority Queue) 难点是自己写comparator。 class comparator { public: bool operator() (const pair<string, int>& a, const pair<string, int>& b) 阅读全文
摘要:
题解 Medium Topological Sort class Solution { public: vector<int> findOrder(int numCourses, vector<vector<int>>& prerequisites) { vector<vector<int>> gr 阅读全文
摘要:
题解 Medium 方法:Topological Sort class Solution { public: bool canFinish(int numCourses, vector<vector<int>>& prerequisites) { vector<vector<int>> graph( 阅读全文