Find Peak Element
A peak element is an element that is strictly greater than its neighbors. Given a 0-indexed integer array nums, find a peak element, and return its index. If the array contains multiple peaks, return the index to any of the peaks.
Find Peak Element

A peak element is an element that is strictly greater than its neighbors. Given a 0-indexed integer array nums, find a peak element, and return its index. If the array contains multiple peaks, return the index to any of the peaks.

Example 1:
Input: {"nums":[1,2,3,1]}
Output: 2
Input
arr ={"nums":[1,2,3,1]}
Target: 0

1

L

2

3

1

R
Variables
No variables to display
DepthFunction Call
Stack empty
0/4