Skip to main content
PreparationZone Logo
PreparationZone
Back to Coding

Coding · Medium · Pro

Search in a row-wise and column-wise sorted matrix

CodingMatrixSenior
Model answerPreview

Approach

  • Start top-right corner.
  • If target smaller, move left; else move down.

Java Solution

Java
boolean searchMatrix(int[][] m, int t…