def binary_search_base(nums: list, target: int) -> int:
    """
    Time complexi O(logn)
    The basic binary search
    nums is a sorted list
    if multi targets in nums, return one target index
    else return -1
    """
    if not nums:
        return -1
    left, right = 0, len(nums) - 1
    while left < right:
        mid = left + (right - left) // 2
        if nums[mid] == target:
            return mid
        elif nums[mid] < target:
            left = mid + 1
        elif nums[mid] > target:
            right = mid - 1
    return -1