Challenge: Peak Element

In this lesson, you will find the peak element in a given array. The peak element is the element that is greater than both of its neighbors.

Peak element

"A peak element in an array is the element which is always greater than or equal to its neighbors."

For example, consider the following array:

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.