int peakIndexInMountainArray(vector<int>& A) { int Len = A.size(); int position = -1; for (int i = 1; i < Len - 1; i++) { if (A[i] > A[i - 1] && A[i] > A[i + 1]) { position = i; break; } } return position; }