Search a 2D Matrix
Medium
Matrix
A matrix has each row sorted left to right and the first element of each row greater than the last element of the previous row. Print true if the target exists in the matrix, otherwise false. Required time: O(log(R * C)).
Constraints
1 <= R, C <= 100 -10^4 <= value, target <= 10^4
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.