//url:https://leetcode.com/problems/peak-index-in-a-mountain-array/description/
class Solution {
public:
int peakIndexInMountainArray(vector& A) {
int size=A.size();
for(int i=0;iA[i+1])
return i;
}
}
};
- 本文作者: royalchen
- 本文链接: http://www.royalchen.com/2018/07/20/leetcode-852-peak-index-in-a-mountain-array/
- 版权声明: 本博客所有文章除特别声明外,均采用 MIT 许可协议。转载请注明出处!