---
# System prepended metadata

title: 0852. Peak Index in a Mountain Array
tags: [Leetcode, Binary Search, Medium]

---

# 0852. Peak Index in a Mountain Array
###### tags: `Leetcode` `Medium` `Binary Search`
Link: https://leetcode.com/problems/peak-index-in-a-mountain-array/description/
## 思路
## Code
```java=
class Solution {
    public int peakIndexInMountainArray(int[] arr) {
        int start = 0, end = arr.length-1;
        while(start<end){
            int mid = start+(end-start)/2;
            if(arr[mid]<arr[mid+1]){
                start = mid+1;
            }
            else end = mid;
        }
        return start;
    }
}
```