【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; }