![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Leetcode 错题
qq_39575851
这个作者很懒,什么都没留下…
展开
-
leetcode 最长回文子串
class Solution {public: string longestPalindrome(string s) { return manachar(s); } string manachar(string &s) { char b[2002]; int p[2002]; int len ...原创 2019-04-16 21:41:41 · 81 阅读 · 1 评论 -
leetcode员工的重要性
/*// Employee infoclass Employee {public: // It's the unique ID of each node. // unique id of this employee int id; // the importance value of this employee int importance; ...原创 2019-05-29 11:33:45 · 228 阅读 · 1 评论 -
重新安排行程
class Solution {public: vector<string> findItinerary(vector<vector<string>>& tickets) { vector<string> res; unordered_map<string, multiset<string...原创 2019-05-05 18:12:59 · 341 阅读 · 3 评论 -
leetcode 997
class Solution {public: int findJudge(int N, vector<vector<int>>& trust) { if(trust.size() == 1) return trust[0][1]; vector<int> dout(N, 0); ...原创 2019-04-29 17:15:36 · 258 阅读 · 1 评论 -
前k个高频单词
class Solution {public: vector<string> topKFrequent(vector<string>& words, int k) { map<string, int> mp; for(int i =0; i < words.size(); i++) { ...原创 2019-04-24 18:04:40 · 258 阅读 · 2 评论 -
和为k的子数组的个数
class Solution {public: int subarraySum(vector<int>& nums, int k) { if(nums.empty()) return 0; map<int, int> mp; mp[0] = -1; int sum = ...原创 2019-04-23 17:01:58 · 781 阅读 · 2 评论 -
和为k的最长子数组
class Solution {public: int subarraySum(vector<int>& nums, int k) { if(nums.empty()) return 0; map<int, int> mp; mp[0] = -1; int sum = ...原创 2019-04-23 16:49:07 · 994 阅读 · 0 评论 -
leetcode 课程表
class Solution {public: bool canFinish(int numCourses, vector<vector<int>>& prerequisites) { int length = prerequisites.size(); vector<int> c(length, 0); ...原创 2019-05-02 13:27:09 · 200 阅读 · 1 评论 -
kMp算法(有大坑)
class Solution {public: int strStr(string haystack, string needle) { if(haystack.size() == needle.size() && haystack == needle) return 0; if(haystack.size() &l...原创 2019-04-26 11:07:53 · 135 阅读 · 1 评论 -
leetcode328 奇偶链表
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode* od...原创 2019-06-04 09:58:09 · 130 阅读 · 0 评论