My first instinct was a linear scan, which obviously works but completely ignores the time constraint.
Use a modified binary search to find a peak element in O(log n) time. At each step, compare the middle element with its neighbors and move towards the side with the larger neighbor, as a peak must exist there. Handle edge cases where the peak is at the boundaries.
Pro tip: Clarify that the array may contain multiple peaks and that returning any peak is acceptable. Also, mention that the algorithm works even if the array has duplicates, but the problem states strictly greater, so duplicates are not peaks.
Confirm that the array is non-empty, that a peak is strictly greater than its neighbors, and that returning any peak index is acceptable. Also, check if the array can have duplicates (though the problem says strictly greater, so duplicates are not peaks).
Check if the first element is a peak (if it's greater than the second) or if the last element is a peak (if it's greater than the second-to-last). If so, return that index.
Initialize left and right pointers. While left <= right, compute mid. If mid is a peak, return mid. Otherwise, if the left neighbor is greater, move right to mid-1; else move left to mid+1.
Justify that moving towards the larger neighbor guarantees finding a peak because the array must have at least one peak, and the slope leads to a local maximum.
State that the time complexity is O(log n) due to halving the search space each iteration, and space complexity is O(1).
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.