上一页 1 2 3 4 5 6 7 8 9 ··· 17 下一页
摘要: 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 阅读(98) 评论(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 阅读(155) 评论(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 阅读(146) 评论(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 阅读(50) 评论(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 阅读(75) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/two-sum/description/ 阅读全文
posted @ 2018-11-19 13:45 JTechRoad 阅读(80) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/linked-list-components/description/ 阅读全文
posted @ 2018-11-19 00:07 JTechRoad 阅读(76) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/jump-game-ii/description/ 阅读全文
posted @ 2018-11-18 16:39 JTechRoad 阅读(83) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/kth-largest-element-in-a-stream/description/ 阅读全文
posted @ 2018-11-18 13:57 JTechRoad 阅读(75) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/add-binary/description/ 阅读全文
posted @ 2018-11-18 13:36 JTechRoad 阅读(74) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 17 下一页