Algorithm : Binary Search

check if mid element smaller than the next one, if true, start = mid+1

check if mid element larger than the previous element, if true, end = mid
public class Solution {
public int findPeakElement(int[] nums) {
int start = 0, end = nums.length1;
while(start < end) {
int mid = start + (end  start)/2;
if(mid < nums.length1 && nums[mid] < nums[mid+1]) {
start = mid+1;
}else if (mid < nums.length1 && nums[mid] > nums[mid+1]) {
end = mid;
}
}
return start;
}
}