Chubb Interview Question

Code for finding peak element