public boolean findNumberIn2DArray(int[][] matrix, int target) { int m = matrix.length; if(0 == m || null == matrix)return false; int n = matrix[0].length; int i = m - 1 , j = 0; while(i >= 0 && j < n) { if(matrix[i][j] == target) { return true; } else if(matrix[i][j] > target) { i--; } else { j++; } } return false; }