题解 | #二维数组中的查找#
二维数组中的查找
https://www.nowcoder.com/practice/abc3fe2ce8e146608e868a70efebf62e
class Solution: def Find(self , target: int, array: List[List[int]]) -> bool: # write code here m = len(array) n = len(array[0]) # 从左下角开始查找 if n==0: return False i,j = m-1,0 while i >= 0 and j <= n-1: if target < array[i][j]: i -= 1 elif target > array[i][j]: j += 1 else: return True else: return False