Is there a solution for the following question that has O(n) efficiency?
You need to find a cell in an array such that all of the numbers before it are lower than it, and all the numbers after it are higher than it. You should ignore first and last cells.
For example, consider the following list:
1, 3, 2, 6, 5, 7, 9, 8, 10, 8, 11
In that case, the answer would be the number
7 at index