3 views
# Peak Index in a Mountain Array (LeetCode 852) — Interview Notes Strictly increasing then strictly decreasing. Binary search for the peak: ```text lo, hi = 0, n-1 while lo < hi: mid = (lo+hi)//2 if arr[mid] < arr[mid+1]: lo = mid+1 else: hi = mid return lo ``` Compare to linear scan O(n). Mention why mid vs mid+1 avoids infinite loops. Tooling note: [undetectable AI interview copilot](https://www.linkjob.ai/interview-copilot/) for live practice (Linkjob AI).