public static boolean Find(int target, int [][] array) {
if(array==null || (array.length==1 && array[0].length==0)){
return false;
}
int index = -1;
for (int i = 0; i < array.length; i++) {
Integer first = array[i][0];
if(first == target){
return true;
}
if(first>target){
index = i;
break;
}
index = i;
}
if(index <= 0){
return false;
}
int rowIndex = -1;
for (int i = index; i >= 0; i--) {
int[] rows = array[i];
rowIndex = rows.length - 1;
for (int j = 0; j <= rowIndex; j++) {
Integer value = rows[j];
if(value == target){
return true;
}
if(value>target){
rowIndex = j;
continue;
}
}
}
return false;
}