Java, Binary Search

public int findPeakElement(int[] nums) { int s = 0, e = nums.length - 1; while(s < e){ int m = (s + e) / 2; boolean leftLess = (m - 1 < 0) || nums[m - 1] < nums[m]; boolean rightLess = (m + 1 >= nums.length) || nums[m + 1] < nums[m]; if(leftLess && rightLess) return m; else if(leftLess) s = m + 1; else e = m; } return s; }Find Peak Element