Amazon Interview Question

I was asked to solve DSA Medium Array based problem[Peak Element, leetcode 162]