74 Search in a 2D Matrix
Write an efficient algorithm that searches for a value in an mxn matrix. This matrix has the following properties:
Integers in each row are sorted from left to right.
The first integer of each row is greater than the last integer of the previous row.
For example,
Consider the following matrix:
Given target=3
, returntrue
.
可以做2次二分,这里做1次二分。
Last updated