LeetCode
Find Peak Element
Click
here
for an explanation.