This commit is contained in:
2022-11-14 11:40:07 +08:00
parent d55c9c43ea
commit 8d4732c963
2 changed files with 64 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
#ifndef S0023_MERGE_K_SORTED_LISTS
#define S0023_MERGE_K_SORTED_LISTS
#include <vector>
using namespace std;
struct ListNode {
int val;
ListNode* next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode* next) : val(x), next(next) {}
};
class Solution {
public:
ListNode* mergeKLists(vector<ListNode*>& lists);
};
#endif