Binary Search in Python, Explained With a Worked Example
You're given a list of integers `nums`, sorted in ascending order, and a value `target`. Write a function that returns the index of `target` if it's in the list and `-1` if it isn't. Your solution has to run in O(log n) time.