Back to Question

Search a 2D Matrix

Question Explain

Write an efficient algorithm that searches for a value in an $m \times n$ matrix. The matrix has sorted rows and the first integer of each row is greater than the last of the previous row. Use two Binary Searches.

Start Trying This Question Simulation

Click "Start Speaking" and answer the question naturally.