题目:
题解:
cpp
bool searchMatrix(int** matrix, int matrixSize, int* matrixColSize, int target){
int i = 0;
int j = matrixColSize[0] - 1;
while(j >= 0 && i < matrixSize){
if(target < matrix[i][j])
j--;
else if(target > matrix[i][j])
i++;
else
return true;
}
return false;
}