题解 | #二维数组中的查找#
二维数组中的查找
https://www.nowcoder.com/practice/abc3fe2ce8e146608e868a70efebf62e
public class Solution {
public boolean Find(int target, int [][] array) {
int i = array.length - 1, j = 0, maxj = array[0].length - 1;
while(i >= 0 && j <= maxj){
if(array[i][j] == target){
return true;
}else if (array[i][j] > target){
i--;
}else{
j++;
}
}
return false;
}
}
#学习##刷题##每日刷题#