NeetCode #788LC-1509MediumGreedy
← Back to All Problems#788 · #1509 · Minimum Difference Between Largest and Smallest Value in Three Moves(三次操作后最大值与最小值的最小差值)
📌 Problem Statement & Constraints
Given an array
nums, in one move you may change any element to any value. Return the minimum difference between the largest and smallest values after at most three moves. Constraints: 1 <= nums.length <= 10^5, -10^9 <= nums[i] <= 10^9.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!