Prompt: Given a list of n numbers, a peak element is an element where it’s greater than its neighbors. Find the peak element within O(log n) time. It can be assumed that the n + 1 th element is negative infinity.

Example:

nums = [1,2,3,1]
3 is a peak element and your function should return the index number 2.
nums = [1,2,1,3,5,6,4]
Your function can return either index number 1 where the peak element is 2, or index number 5 where the peak element is 6.

Solution: This is a simple binary search where the search target is greater than both of its neighbors.