Loading...
Write binary search from scratch. Search a sorted array by halving the search space each step.
Create two pointers: left starting at 0, right starting at the last index
left
right
def binary_search(arr, target): # Return the index of target in sorted arr, or -1 if not found pass