摘要:
class Solution { public: string mostCommonWord(string paragraph, vector& banned) { unordered_set s(banned.begin(), banned.end()); unordered_map m; int idx = 0; ... 阅读全文
posted @ 2018-11-20 00:15
JTechRoad
阅读(107)
评论(0)
推荐(0)
摘要:
class Solution { public: vector removeComments(vector& source) { vector res; string ln; int state = 0; for (const auto & line : source) { for (int i = ... 阅读全文
posted @ 2018-11-20 00:02
JTechRoad
阅读(160)
评论(0)
推荐(0)
摘要:
// 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... 阅读全文
posted @ 2018-11-19 16:45
JTechRoad
阅读(151)
评论(0)
推荐(0)
摘要:
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[... 阅读全文
posted @ 2018-11-19 15:49
JTechRoad
阅读(56)
评论(0)
推荐(0)
摘要:
class Solution { public: int maxProfit(vector& prices) { int res = 0; int low = INT_MAX; for (auto i : prices) { if (i res) res = i - low; ... 阅读全文
posted @ 2018-11-19 13:51
JTechRoad
阅读(80)
评论(0)
推荐(0)
摘要:
https://leetcode.com/problems/two-sum/description/ 阅读全文
posted @ 2018-11-19 13:45
JTechRoad
阅读(88)
评论(0)
推荐(0)
摘要:
https://leetcode.com/problems/linked-list-components/description/ 阅读全文
posted @ 2018-11-19 00:07
JTechRoad
阅读(82)
评论(0)
推荐(0)
摘要:
https://leetcode.com/problems/jump-game-ii/description/ 阅读全文
posted @ 2018-11-18 16:39
JTechRoad
阅读(97)
评论(0)
推荐(0)
摘要:
https://leetcode.com/problems/kth-largest-element-in-a-stream/description/ 阅读全文
posted @ 2018-11-18 13:57
JTechRoad
阅读(84)
评论(0)
推荐(0)
摘要:
https://leetcode.com/problems/add-binary/description/ 阅读全文
posted @ 2018-11-18 13:36
JTechRoad
阅读(77)
评论(0)
推荐(0)
浙公网安备 33010602011771号