classSolution { public: intfindPeakElement(vector<int>&nums) { intl=0,r=nums.size()-1; while(l<r){ intmid=(l+r)/2; if(nums[mid]>nums[mid+1]){ r=mid; } else{ l=mid+1; } } returnl; } };
classSolution { public: intfindPeakElement(vector<int>&nums) { intl=0,r=nums.size()-1; while(l<r){ intmid=(l+r)/2; if(nums[mid]>nums[mid+1]){ r=mid; } else{ l=mid+1; } } returnl; } };