JAVA beats 100% | Clear Explanation
Its actually pretty simple. If you think, we dont need to change any values, it is just that we need to remove any 3 numbers, such that max - min is the least. 
Its actually pretty simple. If you think, we dont need to change any values, it is just that we need to remove any 3 numbers, such that max - min is the least. Now if you sort the array, the best ways to remove the numbers are at the ends, becuase then only you would be able to lessen the range. So you can remove the numbers from the end in 4 ways.\n1. 3 on left, 0 on right\n2. 2 on left, 1 on right\n3. 1 on left, 2 on right\n4. 0 on left, 3 on right\nAnd by finding which of these yields the minimum range, we get our final answer.\nComplexity is O(nlog n) becasue of sorting.\n```\nclass Solution {\n    public int minDifference(int[] nums) {\n        if(nums.length<=3) return 0;\n        Arrays.sort(nums);\n        int lastIndex = nums.length-1;\n        return Math.min(Math.min(nums[lastIndex]-nums[3], nums[lastIndex-3]-nums[0]), Math.min(nums[lastIndex-2]-nums[1],nums[lastIndex-1]-nums[2]));\n    }\n}\n```
[]