Merge K Sorted Linkedlist
easy
You are given an array of k linked-lists, each linked-list is sorted in increasing order. Merge all the linkedlists into one sorted linkedlist and return it.
Constraints
0 <= k <= 10^5 0 <= size of linkedlist <= 1000
Format
Input
3 sorted linkedlist : { 0->0->0->null, 0->0->1->1->1->2->2->4->null, 0->0->0->0->5->5->6->null }
Output
after merging them : 0->0->0->0->0->0->0->0->0->1->1->1->2->2->4->5->5->6->null
Example
Sample Input
3
3
0 0 0
8
0 0 1 1 1 2 2 4
7
0 0 0 0 5 5 6
Sample Output
0 0 0 0 0 0 0 0 0 1 1 1 2 2 4 5 5 6