<awangdev>Search a 2D Matrix II_2.java
public boolean searchMatrix(int[][] matrix, int target) {
        if (matrix == null || matrix.length == 0 || matrix[0].length == 0) {
            return false;
        }
        int row = matrix.length;
        int col = matrix[0].length;
        int x = 0;
        int y = col - 1;
        
        while (x < row && y >= 0) {
            if (matrix[x][y] < target) {
                x++;
            } else if (matrix[x][y] > target) {
                y--;
            } else {
                return true;
            }
        }
        return false;
    }
public boolean var_0 ( int [ ] [ ] var_1 , int var_2 ) {
  if ( var_1 == null || var_1 . length == 0 || var_1 [ 0 ] . length == 0 ) {
    return false ;
  }
  int var_6 = var_1 . length ;
  int var_7 = var_1 [ 0 ] . length ;
  int var_8 = 0 ;
  int var_10 = var_7 - 1 ;
  while ( var_8 < var_6 && var_10 >= 0 ) {
    if ( var_1 [ var_8 ] [ var_10 ] < var_2 ) {
      var_8 ++ ;
    }
    else if ( var_1 [ var_8 ] [ var_10 ] > var_2 ) {
      var_10 -- ;
    }
    else {
      return true ;
    }
  }
  return false ;
}
