1509. Minimum Difference Between Largest and Smallest Value in Three Moves
Description
**Input:** nums = [5,3,2,4]
**Output:** 0
**Explanation:** Change the array [5,3,2,4] to [**2**,**2**,2,**2**].
The difference between the maximum and minimum is 2-2 = 0.**Input:** nums = [1,5,0,10,14]
**Output:** 1
**Explanation:** Change the array [1,5,0,10,14] to [1,**1**,0,**1**,**1**].
The difference between the maximum and minimum is 1-0 = 1.**Input:** nums = [6,6,0,1,1,4,6]
**Output:** 2ac1: PriorityQueue
ac2: Sorting
Last updated