```
int findPeakElement(vector<int>& nums) {
const int size_num = nums.size();
int i = 0, j = size_num - 1;
while (i < j) {
int mid = i + (j - i) / 2;
if (nums[mid] < nums[mid+1]) i = mid + 1;
else j = mid;
}
return i;
}
```