class Solution {
public:
bool Find(int target, vector<vector<int> > array) {
int row = array.size();
int low = array[0].size();
int i=row-1,j=0;
while(i>=0 && j<low) {
if(array[i][j] == target) {
return true;
} else if(array[i][j] > target) {
i--;
} else {
j++;
}
}
return false;
}
};
原文:https://www.cnblogs.com/grglym/p/8906031.html