2024-07-26发表2025-01-15更新LeetCode每日一题几秒读完 (大约77个字)0次访问2740. 找出分区值找出分区值 难度: medium 原始链接: https://leetcode.cn/problems/find-the-value-of-the-partition 标签: 排序, 贪心 解法一: 排序, 贪心go123456789func findValueOfPartition(nums []int) int { n := len(nums) sort.Ints(nums) ans := math.MaxInt for i := 1; i < n; i++ { ans = min(ans, nums[i]-nums[i-1]) } return ans} 2740. 找出分区值https://wuhunyu.top/leetcode/2024/07/find-the-value-of-the-partition/index.html作者wuhunyu发布于2024-07-26更新于2025-01-15许可协议#贪心排序