Community

Start a Thread


Notifications
Subscribe You’re not receiving notifications from this thread.

Find Peak Element (Main Thread)

Here is the interview question prompt, presented for reference.

A peak element is an element that is strictly greater than its neighbors.

Consider that we are given a list of numbers, such as the following:

[1, 2, 3, 1]

Determine the peak element of this list, and return its index. If the array contains multiple peaks, return the index to any of the peaks.

![image](https://storage.googleapis.com/algodailyrandomassets/curriculum/arrays/find-peak-element/problem.png)

Constraints

  • 1 <= nums.length <= 1000
  • -231 <= nums[i] <= 231 - 1
  • nums[i] != nums[i + 1] for all valid i.

You can see the full challenge with visuals at this link.

Challenges • Asked over 2 years ago by Jake from AlgoDaily

Jake from AlgoDaily Commented on Aug 07, 2022:

This is the main discussion thread generated for Find Peak Element (Main Thread).