Simple Python O(m+n) and O(mlg(n)) solution
O(mlog(n))\n\nclass Solution:\n    def searchMatrix(self, matrix, target):\n        m = len(matrix)\n        if m < 1:\n            return False\n        n = le
**O(mlog(n))**\n```\nclass Solution:\n    def searchMatrix(self, matrix, target):\n        m = len(matrix)\n        if m < 1:\n            return False\n        n = len(matrix[0])\n        if n < 1:\n            return False\n        i = 0\n        while i < m and target >= matrix[i][0]:\n            low, high = 0, n\n            while low < high:\n                mid = (low+high)//2\n                if target > matrix[i][mid]:\n                    low = mid + 1\n                elif target < matrix[i][mid]:\n                    high = mid\n                else:\n                    return True\n            i += 1\n        return False\n```\n**O(m+n)**\n```\nclass Solution:\n    def searchMatrix(self, matrix, target):\n        m = len(matrix)\n        if m < 1:\n            return False\n        n = len(matrix[0])\n        if n < 1:\n            return False\n        row, col = 0, n - 1\n        while row < m and col >= 0:\n            curr = matrix[row][col]\n            if target > curr:\n                row += 1\n            elif target < curr:\n                col -= 1\n            else:\n                return True\n        return False\n```
['Binary Tree', 'Python']