<doocs>0074.Search a 2D Matrix_1.py
def searchMatrix( matrix: List[List[int]], target: int) -> bool:
    m, n = len(matrix), len(matrix[0])
    left, right = 0, m * n - 1
    while left < right:
        mid = (left + right) >> 1
        x, y = divmod(mid, n)
        if matrix[x][y] >= target:
            right = mid
        else:
            left = mid + 1
    return matrix[left // n][left % n] == target
def sample_funcname ( var_0 : List [ List [ int ] ] , var_3 : int ) -> bool :
    var_6 , var_8 = len ( var_0 ) , len ( var_0 [ 0 ] )
    var_9 , var_11 = 0 , var_6 * var_8 - 1
    while var_9 < var_11 :
        var_12 = ( var_9 + var_11 ) >> 1
        var_14 , var_15 = divmod ( var_12 , var_8 )
        if var_0 [ var_14 ] [ var_15 ] >= var_3 :
            var_11 = var_12
        else :
            var_9 = var_12 + 1
    return var_0 [ var_9 // var_8 ] [ var_9 % var_8 ] == var_3
