Given an m $ imes$ n matrix grid of integers where each row is sorted in nondecreasing order, return the median of the matrix.
Both m and n are odd integers, which guarantees that the total number of elements in the matrix is odd and the median is unique.
Constraints:
m == grid.length
n == grid[i].length
m, n
m and n are both odd.
grid[i][j]
grid[i] is sorted in nondecreasing order.
Given an m $ imes$ n matrix grid of integers where each row is sorted in nondecreasing order, return the median of the matrix.
Both m and n are odd integers, which guarantees that the total number of elements in the matrix is odd and the median is unique.
Constraints:
m == grid.length
n == grid[i].length
m, n
m and n are both odd.
grid[i][j]
grid[i] is sorted in nondecreasing order.