You are given k linked lists in the array lists. Each list is sorted from small to large. Merge all of them into one sorted linked list, and return it. If there are no lists, or all of them are empty, return an empty list.
How the judge passes the data
Examples
Example 1:
Input: lists = [[2,5,8],[1,6],[3,4,9]]
Output: [1,2,3,4,5,6,8,9]
Explanation: Take the smallest value from the fronts of the lists again and again: 1, 2, 3, 4, 5, 6, 8, 9.
Example 2:
Input: lists = [[],[7],[]]
Output: [7]
Explanation: Only one list has a node.