# 162. Find Peak Element

{% embed url="<https://leetcode.com/problems/find-peak-element/>" %}

题目都说假设两头是负无穷，那利用一下大小关系的传导，直接遍历`array`即可...

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