Find Peak Element

A peak element is an element that is strictly greater than its neighbors. Given an array of integers, find a peak element and return its index.

Examples

Example 1:

Input:

nums = [1,2,3,1]

Output:

2
Loading...
Find Peak Element - Binary Search DSA Problem