<doocs>1855.Maximum Distance Between a Pair of Values_1.py
def maxDistance( nums1: List[int], nums2: List[int]) -> int:
    ans, n = 0, len(nums2)
    for i, num in enumerate(nums1):
        left, right = i, n - 1
        while left < right:
            mid = (left + right + 1) >> 1
            if nums2[mid] >= num:
                left = mid
            else:
                right = mid - 1
        ans = max(ans, left - i)
    return ans
def sample_funcname ( var_0 : List [ int ] , var_3 : List [ int ] ) -> int :
    var_5 , var_7 = 0 , len ( var_3 )
    for var_9 , var_10 in enumerate ( var_0 ) :
        var_11 , var_13 = var_9 , var_7 - 1
        while var_11 < var_13 :
            var_14 = ( var_11 + var_13 + 1 ) >> 1
            if var_3 [ var_14 ] >= var_10 :
                var_11 = var_14
            else :
                var_13 = var_14 - 1
        var_5 = max ( var_5 , var_11 - var_9 )
    return var_5
