Tap here to switch tabs
Problem
Submissions

Problem: Median of a Row Wise Sorted Matrix

med
30 min
Try to solve the Median of a Row Wise Sorted Matrix problem.

Statement

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

  • 1≤1 \leq m, n ≤500\leq 500

  • m and n are both odd.

  • 1≤1 \leq grid[i][j] ≤106\leq 10^6

  • grid[i] is sorted in nondecreasing order.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Median of a Row Wise Sorted Matrix

med
30 min
Try to solve the Median of a Row Wise Sorted Matrix problem.

Statement

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

  • 1≤1 \leq m, n ≤500\leq 500

  • m and n are both odd.

  • 1≤1 \leq grid[i][j] ≤106\leq 10^6

  • grid[i] is sorted in nondecreasing order.