【leetcode】240. 搜索二维矩阵 II
作者:互联网
bool searchMatrix(int** matrix, int matrixSize, int* matrixColSize, int target){ int row = matrixSize-1; int col = 0; while (row >= 0 && col < *matrixColSize) { if (matrix[row][col] > target) { row--; } else if (matrix[row][col] < target) { col++; } else { // found it return true; } } return false; }
标签:matrixSize,matrix,int,leetcode,II,240,target,col,row 来源: https://www.cnblogs.com/ganxiang/p/14241576.html