Solución

@drserch·5/5/2026TypeScript
solution.tsTypeScript
export function searchMatrix(matrix: number[][], target: number): boolean {  
  let row = 0;
  let col = matrix[0].length - 1;

  while (row < matrix.length && col >= 0) {
    const val = matrix[row][col];
    if (val === target) return true;
    val > target ? col-- : row++;
  }

  return false
}
0respuestas
Respuestas

Aún no hay respuestas

¡Sé el primero en responder!

Escribir un comentario

Recuerda ser amable. Estás comentando la solución de otra persona. Comparte tu perspectiva de forma constructiva y respetuosa.

Debes iniciar sesión para publicar un comentario.