binary_search(arr, target) on a sorted list of ints, returning the index of target, or -1 if it is absent. Solve it with recursive divide-and-conquer — no loops.binary_search([1,3,5,7,9,11], 7)
3
7 sits at index 3 of the sorted list.
binary_search([1,3,5,7,9,11], 4)
-1
4 is not present.
Track a lo/hi window, e.g. via a nested helper function.
Compare arr[mid] to target and recurse into the correct half.