Given an array of integers find a peak element.
A peak element is an element which is bigger than its neighbours.
If there are more than one peak, return any one.
a = [1, 2, 3, 2]
ans = 2 (we are returning the index).
We can solve this problem in O(log(N)) using binary search.
The idea is to check if the middle element is greater or smaller than its next element.
If the middle element is greater, than a peak will definitely exist in the left subarray, otherwise a peak will definitely exist in the right subarray.