func targetMin(nums []int, target int) int { left := 0 right := len(nums) - 1 for left < right { mid := ((right - left + 1) >> 1) + left if nums[mid] >= target { right = mid - 1 } else { left = mid } } if nums[left] >= target { return -1 } return left }