arrays is a list of k lists, each sorted in increasing order. Merge them into one sorted list.
For [[1, 4, 5], [1, 3, 4], [2, 6]] the answer is [1, 1, 2, 3, 4, 4, 5, 6].
Example 1
Input:
merge_k_arrays([[1, 4, 5], [1, 3, 4], [2, 6]])
Output:
[1, 1, 2, 3, 4, 4, 5, 6]
Example 2
Input:
merge_k_arrays([[], [1]])
Output:
[1]
0 <= k <= 100000 <= total number of values <= 200000-10**9 <= value <= 10**9No results yet
Run your code to check it against the examples, or submit to run every test.