func search( nums []int ,  target int ) int {
    // write code here
    if len(nums) == 0 {
        return -1
    }

    l, r := 0, len(nums)-1

    for l <= r {
        middle := l + (r-l)>>2

        if nums[middle] == target {
            r = middle -1
        }else if nums[middle] > target {
            r = middle -1
        }else if nums[middle] < target {
            l = middle +1
        }
    }

    if l >= len(nums) || nums[l] != target {
        return -1
    }
    return l
}