Solution: Peak Index in a Mountain Array
C# solution for the Peak Index in a Mountain Array problem using the Modified Binary Search pattern.
We'll cover the following...
We'll cover the following...
Statement
Given an integer array arr that is guaranteed to be a mountain array, return the index of its peak element. The peak is the element that is strictly greater than its adjacent elements, where values strictly increase up to the peak and then strictly decrease after it.
Note: A mountain array has some index
isuch thatarr[0]<arr[1]<...<arr[i]andarr[i]>arr[i+1]>...>arr[arr.length - 1].
Constraints:
...