115. Merge K Sorted Arrays
HardPriority queues & heaps
Merge k sorted arrays into one sorted array. Aim for O(N log k), where N is the total number of values.
Example 1
Input: lists = [[1, 4, 5], [1, 3, 4], [2, 6]] Output: [1, 1, 2, 3, 4, 4, 5, 6]
Constraints
0 ≤ k ≤ 10⁴