Tap here to switch tabs
Problem
Submissions

Problem: Search a 2D Matrix

med
30 min
Try to solve the Search a 2D Matrix problem.

Statement

Given a two dimensional integer array matrix with m rows and n columns, determine whether the integer target exists in matrix. Return true if target is present, otherwise return false.

The array matrix is sorted such that each row is in nondecreasing order, and the first element of each row is greater than the last element of the previous row.

Constraints:

  • m == matrix.length

  • n == matrix[i].length

  • 11 \leq m, n 100\leq 100

  • 104-10^4 \leq matrix[i][j], target 104\leq 10^4

Tap here to switch tabs
Problem
Submissions

Problem: Search a 2D Matrix

med
30 min
Try to solve the Search a 2D Matrix problem.

Statement

Given a two dimensional integer array matrix with m rows and n columns, determine whether the integer target exists in matrix. Return true if target is present, otherwise return false.

The array matrix is sorted such that each row is in nondecreasing order, and the first element of each row is greater than the last element of the previous row.

Constraints:

  • m == matrix.length

  • n == matrix[i].length

  • 11 \leq m, n 100\leq 100

  • 104-10^4 \leq matrix[i][j], target 104\leq 10^4