You are given k sorted linked lists. Your task is to merge all of them into one sorted linked list.
Input: lists = [[2,5,7],[1,3,6],[4,8]]
Output: [1,2,3,4,5,6,7,8]
Explanation:
The linked-lists are: 2->5->7 1->3->6 4->8 After merging: 1->2->3->4->5->6->7->8
Input: Input: lists = []
Output: []
Input: lists = [[]]
Output: []
Accepted:
Submission: