First Element With Two Strictly Larger Neighbors

Given an integer array nums, return the first element from left to right whose immediate left and right neighbors are both strictly larger than it.

Find the smallest index i (`1 <= i <= n - 2...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: