public class Solution {
    public boolean Find(int target, int [][] array) {
        if(array==null||array.length==0){
            return false;
        }
        int i=array.length-1;
        int j =0;

    while(i>=0&&j<array[0].length){
        if(target==array[i][j]){
            return true;
        }
       else if(target<array[i][j]){
            i--;
        }
        else{
            j++;
    }
}
        return false;
} 
}