Java based solution using Sliding Window O(nLogn)
Intuition\nHere you have to find the minumum difference between the largest and the smallest number by making/considering any other three numbers in the array e
**Intuition**\nHere you have to find the minumum difference between the largest and the smallest number by making/considering any other three numbers in the array equal to whatever number from the same array. Confused? I was too . \n\nIt\'s actually simple, all you have to do is to see this problem in a different way. It\'s asking us to return the minimum difference between smallest and largest number of the array considering there are only N - 3 element at each run (N - length of array). \nThe reason we substracted by 3 is because in the problem it says we can replace any number using three move. Using this we will just increment our pointers (walker and looper) and get the difference between the first element and the last element in that range and get the minimum from it to get the result.\n``` n-3-1 ``` will be the last element in the first interation.\n\nOne more thing for array with length between 0 - 4 the answer will always be 0, reason being we can just replace the maximum number with the other three and then difference will be 0.\n\n```\nclass Solution {\n    public int minDifference(int[] nums) {\n        int n = nums.length;\n        if(n < 5) return 0;\n        Arrays.sort(nums);//O(nLogn) this uses TimSort\n        int walker = 0, looper = n - 3 - 1;\n        int res = Integer.MAX_VALUE;\n        while(walker < n && looper < n) {\n            res = Math.min(res, (nums[looper++] - nums[walker++]));\n        }\n        return res;\n    }\n}\n```\n\nReference \n1. [LeetCode Discuss](https://leetcode.com/problems/minimum-difference-between-largest-and-smallest-value-in-three-moves/discuss/731233/Similar-to-1423.-Maximum-Points-You-Can-Obtain-from-Cards)
['Sliding Window', 'Sorting', 'Java']