← Questions
Find a local minimum in an array
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Return the index of any element smaller than its neighbours (the ends compare with their one neighbour). A linear scan works; the follow-up is logarithmic time by binary searching toward the smaller neighbour.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding

