<doocs>0287.Find the Duplicate Number_1.py
def findDuplicate( nums: List[int]) -> int:
    left, right = 1, len(nums) - 1
    while left < right:
        mid = (left + right) >> 1
        cnt = sum(v <= mid for v in nums)
        if cnt > mid:
            right = mid
        else:
            left = mid + 1
    return left
def sample_funcname ( var_0 : List [ int ] ) -> int :
    var_4 , var_6 = 1 , len ( var_0 ) - 1
    while var_4 < var_6 :
        var_7 = ( var_4 + var_6 ) >> 1
        var_10 = sum ( var_8 <= var_7 for var_8 in var_0 )
        if var_10 > var_7 :
            var_6 = var_7
        else :
            var_4 = var_7 + 1
    return var_4
