```
def searchMatrix(self, matrix, target):
"""
:type matrix: List[List[int]]
:type target: int
:rtype: bool
"""
if matrix:
row_start, row_end = 0, len(matrix) - 1
col_start, col_end = 0, len(matrix[0]) - 1
last_block_size = (row_end - row_start + 1) * (col_end - col_start + 1)
try:
while True:
while matrix[row_start][col_end] < target: # if the last element of the row is smaller than target , the entire row is smaller than target
row_start += 1
while matrix[row_end][col_start] < target: # if last element of column is smaller than target, the entire column is smaller than target
col_start += 1
while matrix[row_start][col_end] > target: # if the first element of the column is larger than target, the entire column is larger than target
col_end -= 1
while matrix[row_end][col_start] > target: # if the first element of the row is larger than target, the entire row is larger than target
row_end -= 1
if row_start > row_end or col_start > col_end:
return False
block_size = (row_end - row_start + 1) * (col_end - col_start + 1)
if block_size == last_block_size: # which means at least one corner is neither larger than target nor smaller than target
return True
else:
last_block_size = block_size
except IndexError:
return False
else:
return False
```

The strategy is to narrow down the size of block, where the target may be located.