class Solution

{

```
public:
ListNode* mergeKLists(vector<ListNode*>& list_vec)
{
vector<int> tmp_vec;
for (unsigned int i = 0; i < list_vec.size(); i++)
{
while (list_vec[i])
{
tmp_vec.push_back(list_vec[i]->val);
list_vec[i] = list_vec[i]->next;
}
}
sort(tmp_vec.begin(), tmp_vec.end());
ListNode head(-1);
ListNode* res_list = &head;
ListNode* cur_node = res_list;
for (unsigned int i = 0; i < tmp_vec.size(); i++)
{
cur_node->next = new ListNode(tmp_vec[i]);
cur_node = cur_node->next;
}
return res_list->next;
}
```

};