```
public int FindPeakElement(int[] nums) {
if (nums.Length < 2)
return 0;
int start = 0;
int end = nums.Length - 1;
while (start < end - 1)
{
int mid = (start + end) / 2;
if (nums[mid] > nums[mid + 1])
{
end = mid;
}
else
{
start = mid + 1;
}
}
return nums[start] > nums[end] ? start : end;
}
```