#include<vector>
#include<iostream>
using namespace std;
class Solution {
public:
bool Find(int target, vector<vector<int>> array) {
int y = array.size();
if (y == 0)
return false;
int x = array[0].size();
if (x == 0)
return false;
y = 0;
x = x - 1;
while (y < array.size() && x >= 0) {
if (target == array[y][x])
return true;
else if (target > array[y][x]) {
y += 1;
}
else {
x -= 1;
}
}
return false;
}
};
转载请注明原文地址:https://blackberry.8miu.com/read-8132.html