
LeetCode
sumword_
这个作者很懒,什么都没留下…
展开
-
LeetCode_2 add_two_numbers 两数之和
简单题ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) { ListNode * l3, *head; head = new ListNode(-1); l3 = head; int flag=0; while(l1 || l2 || flag){ int sum = 0; ...原创 2019-02-07 22:46:20 · 111 阅读 · 0 评论 -
LeetCode_3 无重复字符的最长子串 longest-substring-without-repeating-characters
滑动窗口,简单题int lengthOfLongestSubstring(string s) { unordered_map<char, int> mymap; int pre = 0; int maxx = 0; for(int i = 0; i < s.size(); i++){ if(mymap.find(s[i]) ...原创 2019-02-07 23:44:47 · 120 阅读 · 0 评论