Palo Alto Networks Interview Question

Find the peak element using binary search