Write an efficient algorithm that searches for a value in a 2D matrix. The matrix has the following properties:
true if the target is found, false otherwise.Example 1
Input: 3 4 1 3 5 7 10 11 16 20 23 30 34 60 3
Output: true
The target 3 is found in the matrix.
Constraints
Hints
Write an efficient algorithm that searches for a value in a 2D matrix. The matrix has the following properties:
true if the target is found, false otherwise.Example 1
Input: 3 4 1 3 5 7 10 11 16 20 23 30 34 60 3
Output: true
The target 3 is found in the matrix.
Constraints
Hints