def binary_search(collection, target):
lo, hi = (0, len(collection)-1)
while(lo <= hi):
mid = (lo+hi)//2
if(collection[mid] == target):
return mid
elif collection[mid] > target:
hi = mid - 1
elif collection[mid] < target:
lo = mid + 1
return -1