← Questions

Find a local minimum in an array

0
MetaUberCodingLast asked Apr 2026

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.

Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding