peek element
class Solution {
public int findPeakElement(int[] nums) {
int n = nums.length;
int left = 0, right = n - 1;
int ans = 0; // default (there is always at least one peak)
while (left <= right) {
int mid ...
yesamitsingh.hashnode.dev1 min read