LeetCode—852. Peak Index in a Mountain Array


//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;
        }        
    }
};


发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注