class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int target) {
if(matrix.empty()||matrix[0].empty()) return false;
int n=matrix.size(),m=matrix[0].size();
int x=0,y=m-1;
while(x<n&&y>=0)
{
if(matrix[x][y]==target) return 1;
if(matrix[x][y]>target) y--;
else if(matrix[x][y]<target) x++;
}
return false;
}
};
标签:Leetcode240,return,matrix,int,矩阵,II,size,target
From: https://www.cnblogs.com/tangxibomb/p/17555559.html