In a Meta-style feed aggregation service, multiple independently sorted streams must be combined into one globally sorted result. Given k sorted integer lists, merge them into a single sorted list.
Implement a function that takes lists, where lists[i] is a sorted list of integers in non-decreasing order, and returns a single list containing all values from every input list in non-decreasing order.
lists: List[List[int]]List[int]Example 1
lists = [[1,4,5],[1,3,4],[2,6]][1,1,2,3,4,4,5,6]Example 2
lists = [[], [0], [-2, 7, 9]][-2,0,7,9]0 <= k <= 10^40 <= len(lists[i]) <= 10^4-10^9 <= lists[i][j] <= 10^910^5.Aim for a solution better than flattening and re-sorting all values when k is much smaller than the total number of elements.