Guest User

Untitled

a guest
Jun 18th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. class Solution {
  2. public:
  3. int peakIndexInMountainArray(vector<int>& A) {
  4. int ans = -1;
  5. for(int i=1;i<A.size();i++){
  6. if(A[i-1] > A[i])
  7. return ans=i-1;
  8. }
  9. return ans;
  10. }
  11. };
Add Comment
Please, Sign In to add comment