2023-12-18发表2023-12-18更新LeetCode每日一题几秒读完 (大约70个字)0次访问162. 寻找峰值162. 寻找峰值 难度: medium 原始链接: https://leetcode.cn/problems/find-peak-element 标签: 二分查找 解法一: 半分查找go12345678910111213func findPeakElement(nums []int) int { left := 0 right := len(nums) - 1 for left < right { mid := ((right - left) >> 1) + left if nums[mid] < nums[mid + 1] { left = mid + 1 } else { right = mid } } return left}162. 寻找峰值https://wuhunyu.top/leetcode/2023/12/find-peak-element/index.html作者wuhunyu发布于2023-12-18更新于2023-12-18许可协议#二分查找