Dashboard Temp Share Shortlinks Frames API

HTMLify

LeetCode - Search a 2D Matrix - Python
Views: 609 | Author: abh
1
2
3
4
5
6
class Solution:
    def searchMatrix(self, matrix: List[List[int]], target: int) -> bool:
        for row in matrix:
            if target in row:
                return True
        return False