Awesome Logic With Time Complexity---->O(N)
\n\n# Normal Approach---->O(N)\n\nclass Solution:\n    def searchMatrix(self, matrix: List[List[int]], target: int) -> bool:\n        row,col=len(matrix),len(ma
\n\n# Normal Approach---->O(N)\n```\nclass Solution:\n    def searchMatrix(self, matrix: List[List[int]], target: int) -> bool:\n        row,col=len(matrix),len(matrix[0])\n        r,c=0,col-1\n        while r<row and c>=0:\n            if matrix[r][c]==target:\n                return True\n            if matrix[r][c]>target:\n                c-=1\n            else:\n                r+=1\n        return False\n    //please upvote me it would encourage me alot\n\n```\n# Binary Search Approach--->O(NLogN)\n```\nclass Solution:\n    def searchMatrix(self, matrix: List[List[int]], target: int) -> bool:\n        rows,col=len(matrix),len(matrix[0])\n        for row in matrix:\n            left,right=0,len(row)-1\n            while left<=right:\n                mid=(left+right)//2\n                if row[mid]==target:\n                    return True\n                if row[mid]>target:\n                    right=mid-1\n                else:\n                    left=mid+1\n        return False\n    //please upvote me it would encourage me alot\n\n\n```\n# please upvote me it would encourage me alot\n
['Python3']