Given an integer array nums, you can change at most 3 elements to any value. Return the minimum possible difference between the maximum and minimum of nums after exactly 0–3 changes.
Input: Integer array nums.
Output: Integer — minimum possible (max - min) after at most 3 changes.
Input: [5,3,2,4]
Output: 0
Explanation: Change all 4 elements to same value, but we have 4 elements and 3 moves. Actually change 3: make 5→2, 4→2, or 3→2. Diff=0.Input: [1,5,0,10,14]
Output: 1
Explanation: Sort: [0,1,5,10,14]. Best: remove 3 from right (diff=5-0=5) or 2 from right+1 from left (10-1=9) etc. Min=1: change 0,1,14→5: diff=10-5=5. Actually computed: min(14-3,10-2,5-1,1-0)=min(11,8,4,1)=1.Input: [3,100,20]
Output: 0
Explanation: len<=4 → return 0 (can change all but one).1<=nums.length<=10^51<=nums[i]<=10^9