11 2021 档案
摘要:/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) :
阅读全文
摘要:https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/ ##解法一 基于红黑树(set)的遍历法(自己瞎编的 维护一个set,set中存放着到s[i]为止的最长无重复字符子串。 同时维护stPo
阅读全文
摘要:39. 组合总和 https://leetcode-cn.com/problems/combination-sum/ 拿到题比较贪心,希望用比较简洁的方法想出来,不要太高的复杂度。隐隐约约记得好像这种题应该是用回溯搜索来写,但是刚刚拿题的时候居然没想出来。。。晚上洗完衣服,灵光乍现,一气呵成。 cl
阅读全文