摘要:
class Solution { public: string mostCommonWord(string paragraph, vector& banned) { unordered_set s(banned.begin(), banned.end()); unordered_map m; int idx = 0; ... 阅读全文
摘要:
class Solution { public: vector removeComments(vector& source) { vector res; string ln; int state = 0; for (const auto & line : source) { for (int i = ... 阅读全文
摘要:
// see more at https://www.youtube.com/watch?v=j68OXAMlTM4 // https://leetcode.com/problems/reverse-pairs/discuss/97268/general-principles-behind-problems-similar-to-reverse-pairs // http://www.cnblo... 阅读全文
摘要:
class Solution { public: void merge(vector& nums1, int m, vector& nums2, int n) { int i = m + n - 1; m--; n--; while (m >= 0 && n >= 0) { if (nums1[m] > nums2[... 阅读全文
摘要:
class Solution { public: int maxProfit(vector& prices) { int res = 0; int low = INT_MAX; for (auto i : prices) { if (i res) res = i - low; ... 阅读全文
摘要:
https://leetcode.com/problems/two-sum/description/ 阅读全文
摘要:
https://leetcode.com/problems/linked-list-components/description/ 阅读全文
摘要:
https://leetcode.com/problems/jump-game-ii/description/ 阅读全文
摘要:
https://leetcode.com/problems/kth-largest-element-in-a-stream/description/ 阅读全文
摘要:
https://leetcode.com/problems/add-binary/description/ 阅读全文