Search⌘ K
AI Features

DIY: Search a 2D Matrix II

Understand how to search a target value in a 2D matrix where rows and columns are sorted. Learn to write an algorithm that returns whether the target exists, preparing you for related coding interview questions.

Problem statement

Write an algorithm that searches for a target value in an m x n integer matrix.

The matrix has the following properties:

  • Integers in each row are sorted in ascending ...