# 852. Peak Index in a Mountain Array

{% embed url="<https://leetcode.com/problems/peak-index-in-a-mountain-array/solution/>" %}

用Q162的code，一点不改，都可以过...

{% content-ref url="162.-find-peak-element" %}
[162.-find-peak-element](https://xuqiangwen1994.gitbook.io/practice/162.-find-peak-element)
{% endcontent-ref %}

```python
class Solution:
    def peakIndexInMountainArray(self, A: List[int]) -> int:
        for i in range(len(A)-1):
            if A[i] > A[i+1]: return i
        return len(A)-1
```
