This passed as accepted and i was wondering what's the catch, as it seems too simple for a Medium difficulty task.

```
public int FindPeakElement(int[] nums) {
int length = nums.Length;
if(length == 0)
return -1;
if(length == 1)
return 0;
if(nums[0] > nums[1])
return 0;
else if(length == 2)
return 1;
for(int i = 1; i < length ; i++)
{
if (i + 1 == length )
{
if (nums[i] > nums[i - 1])
return i;
}
if (nums[i - 1] < nums[i] && nums[i + 1] < nums[i])
return i;
}
return -1;
}
```