```
class Solution(object):
def searchMatrix(self, matrix, target):
"""
:type matrix: List[List[int]]
:type target: int
:rtype: bool
"""
l = len(matrix)
c = 0
if matrix:
for i in range(l):
if target in matrix[i]:
return True
else:
c += 1
continue
if c == l:
return False
else:
return False
```