Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def searchMatrix(self, matrix: List[List[int]], target: int) -> bool:
- a=[]
- for i in range(len(matrix)):
- if target<= matrix[i][len(matrix[0])-1]:
- a=matrix[i]
- break
- for j in range(len(a)):
- if target==a[j]:
- return True
- else:
- return False
Advertisement
Add Comment
Please, Sign In to add comment