Sorting ||| Greedy
Cover all the cases:\n\n- If\n    - The number of elements are $\u2264 4$ then we can simply make largest 3 equal to smallest\n- Else\n    - Return the minimum 
# Cover all the cases:\n\n- If\n    - The number of elements are $\u2264 4$ then we can simply make largest 3 equal to smallest\n- Else\n    - Return the minimum of converting smallest 3 to 4th smallest\n    - smallest $2$ elements to $3^{rd}$ smallest, and largest to $2^{nd}$ largest\n    - smallest $1$ to $2^{nd}$ smallest and the 2 largest to $3^{rd}$ largest\n    - $3$ largest elements to the $4^{th}$ largest.\n    - and do the difference for each case, with the largest of new with the smallest of the new.\n# Code\n```\nclass Solution {\npublic:\n    int minDifference(vector<int>& nums) {\n        sort(nums.rbegin(), nums.rend());\n        if(nums.size()<=4){\n            return 0;\n        }\n        cout<<nums[3]-nums[0]<<endl;\n\n        return min(nums[3]-nums[nums.size()-1], min(nums[0]-nums[nums.size()-4], min(nums[1]-nums[nums.size()-3],nums[2]-nums[nums.size()-2])));\n    }\n};\n```
['Array', 'Greedy', 'Sorting', 'C++']