- 博客(3)
- 收藏
- 关注
原创 LeetCode 最长回文子串(C++)
暴力解决(超时): //是否是回文串 bool is(string str) { if (str.length() == 1) return true; else if (str.length() == 2) { if (str[0] == str[1]) return true; else return false; } else if (str[0] ==...
2019-03-10 16:33:20 66
原创 LeetCode 无重复字符的最长子串(C++)
class Solution { public: int lengthOfLongestSubstring(string s) { int len = 0; set<char> substr; for(int i=0; i<s.length(); i++) { substr.clea...
2019-03-08 14:44:46 110
原创 LeetCode 两数相加(C++)
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* a...
2019-03-08 13:54:49 155
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人