Merging K Sorted Lists
Given a list of sorted lists of integers, merge them into one large sorted list.
Constraints
0 ≤ n * m ≤ 100,000
wheren
is number of rows andm
is the longest column inlists
https://binarysearch.com/problems/Merging-K-Sorted-Lists
Examples
Example 1
Input
- lists =
[[], [], [10, 12], [], [3, 3, 13], [3], [10], [0, 7]]
Output
- answer =
[0, 3, 3, 3, 7, 10, 10, 12, 13]
Leave a comment