```
class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int target) {
int row = 0;
for( ; row < matrix.size(); row++ )
if( matrix[ row ][ 0 ] > target )
break;
if( --row < 0 )
return false;
for( int n : matrix[ row ] )
if( n == target )
return true;
return false;
}
};
```