Complete the code to initialize the middle index for binary search.
int mid = low + (high [1] low) / 2;
The middle index is calculated by subtracting low from high, then dividing by 2, and adding low back.
Complete the condition to check if mid is a peak element.
if ((mid == 0 || nums[mid] > nums[mid - 1]) && (mid == nums.Length - 1 || nums[mid] > nums[[1]]))
To check if mid is a peak, compare nums[mid] with the next element nums[mid + 1].
Fix the error in updating the high pointer when the left neighbor is greater.
if (nums[mid] < nums[mid - 1]) { high = [1]; } else { low = mid + 1; }
If the left neighbor is greater, move high to mid - 1 to search left side.
Fill both blanks to complete the binary search loop condition and mid calculation.
while (low [1] high) { int mid = low + (high [2] low) / 2;
The loop runs while low is less than high, and mid is calculated using subtraction.
Fill in the blank to return the peak element index after the loop.
return [1];
After the loop, low and high converge to the peak index, so return low.
