Stefan | ᕕ(◠ڼ◠)ᕗ says to 電訊台
class Solution: def searchMatrix(self, matrix: List[List[int]], target: int) -> bool: m, n = len(matrix), len(matrix[0]) x, y = 0, 0 while x != m: low, high, mid = 0, n - 1, 0 while low <= high: mid = (high + low) // 2 if matrix[x][mid] < target: low = mid + 1 elif matrix[x][mid] > target: high = mid - 1 else: return True x += 1 return False 無聊做咗今日leetcode