variantion https://leetcode.com/problems/merge-k-sorted-lists/
but instead of the linked lists you should merge the matrix rows (numbers in rows are sorted)
public int[] mergeSortedArrays(int[][] a) {
//....
}solved the problem successfully
please, pay attention, you won't get exact leetcode problems but their variantions. hence it is essential to understand the concepts.