摘要:
链接:https://leetcode-cn.com/problems/merge-k-sorted-lists/ 代码 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; 阅读全文
摘要:
链接:https://leetcode-cn.com/problems/generate-parentheses/ 分析 1.任意前缀中左括号数大于等于右括号数; 2.结果中左括号数等于右括号数。 算法(dfs)代码 class Solution { public: vector<string> a 阅读全文
摘要:
链接:https://leetcode-cn.com/problems/merge-two-sorted-lists/ 代码 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *nex 阅读全文