class Solution { public: int findPeakElement(vector<int>& nums) { const int n = nums.size(); int state = 1; // 记录峰与左元素的比较大小状态 for (int i = 1; i < n; ++i) { if (nums[i - 1] <= nums[i]) { // 上升状态,更新state state = nums[i - 1] != nums[...