How would you implement binary search?
Implement binary_search(nums, target) for an ascending sorted array. Return any index containing target, or -1 if the target is absent.
nums is a list of integers and target is an integer. The function returns an integer index.
def binary_search(nums, target):