2022-11-21 13:15:56 +00:00
|
|
|
#ifndef S0023_MERGE_K_SORTED_LISTS_HPP
|
|
|
|
#define S0023_MERGE_K_SORTED_LISTS_HPP
|
2022-11-14 03:40:07 +00:00
|
|
|
|
|
|
|
#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
|