Guest User

Untitled

a guest
Jun 22nd, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. class Solution {
  2. public int peakIndexInMountainArray(int[] A) {
  3. int ans = -1, number = Integer.MIN_VALUE;
  4.  
  5. for(int i = 0; i < A.length; i++) {
  6. if(A[i] > number) {
  7. ans = i;
  8. number = A[i];
  9. }
  10. }
  11.  
  12. return ans;
  13. }
  14. }
Add Comment
Please, Sign In to add comment