Solución
solution.tsTypeScript
public class Solution {
public boolean searchMatrix(int[][] matrix, int target) {
int row = 0;
int col = matrix.length - 1;
while (row < matrix.length && col >= 0) {
if (matrix[row][col] == target) {
return true;
}
if (matrix[row][col] > target) {
col--;
} else {
row++;
}
}
return false;
}
}0respuestas