int findPeakElement(int* nums, int numsSize) {

```
if(numsSize==1)
return 0;
if(numsSize==2){
if(nums[0]>nums[1])
return 0;
else
return 1;
}
int i,j,k;
for(i=0;i<=numsSize-1;i++){
j=i+1;
k=i-1;
if(nums[i]>nums[j] && nums[i]>nums[k]){
return i;
}
}
```

}