Challenge: Peak Element

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

Peak Element

A peak element in an array is the element which is greater than or equal to its neighbors. For elements at the end of an array, we only consider its single neighbor.

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