Guest User

Untitled

a guest
Mar 19th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. class Solution {
  2. public int findPeakElement(int[] nums) {
  3. for (int i = 0; i + 1 < nums.length; i++) {
  4. if (nums[i] > nums[i + 1]) {
  5. return i;
  6. }
  7. }
  8. return nums.length - 1;
  9. }
  10. }
Add Comment
Please, Sign In to add comment