How would you solve binary search in a 2D array II style problem?
Implement search_matrix(matrix, target) to return True if target appears in a non-empty matrix whose rows and columns are sorted in nondecreasing order, otherwise return False. Use an efficient search strategy with constant auxiliary space.
def search_matrix(matrix, target):