The Nielsen measurement pipeline receives k sorted arrays of event timestamps from separate sources. Merge them into one sorted array while preserving duplicates and the overall nondecreasing order.
Use an algorithm that remains efficient when there are many input arrays and each array may have a different length.
Implement merge_sorted_arrays(arrays).
arrays, a list of k arrays. Each inner array contains integers sorted in nondecreasing order.arrays is empty or all inner arrays are empty, return [].def merge_sorted_arrays(arrays):