class Solution:
# array 二维列表
def Find(self, target, array):
# write code here
if not array:
return None
rowLen = len(array)
colLen = len(array[0])
row = 0
col = colLen - 1
while col >=0 and row < rowLen:
tmp = array[row][col]
if tmp == target:
return True
elif tmp > target:
col -= 1
else:
row += 1
return False
网友评论