Simple Diagram Explanation
Idea\n- Sort nums so that we can easily access maximum and minimum values\n- We will always make the low score 0 by creating duplicate values\n- Now we have cha
# Idea\n- Sort `nums` so that we can easily access maximum and minimum values\n- We will always make the low score $$0$$ by creating duplicate values\n- Now we have changed the question to finding the minimum maximum value difference by changing two values\n- We have three options:\n    - Change the two largest values to the third largest value. Third largest value now becomes the max value.\n    - Change the two smallest values to the third smallest value. Third smallest value now becomes the min value.\n    - Change largest value to second largest value and smallest value to second smallest value. Second largest becomes max value and second smallest becomes min value.\n- It must be one of these three options because we have to create duplicates to satisfy the low score constraint and the high score always deals with difference between maximum and minimum.\n\n\n# Example\n\n- Let us use `nums = [1,4,7,8,5]`\n\n![1.jfif](https://assets.leetcode.com/users/images/cd239624-970e-4050-b0d4-d691e9a1fdc8_1676750417.0719316.jpeg)\n\n\n\n# Code\n```\nclass Solution {\npublic:\n    int minimizeSum(vector<int>& nums) {\n        sort(nums.begin(), nums.end());\n        int n = nums.size();\n        return min(nums[n-1]-nums[2], min(nums[n-2]-nums[1], nums[n-3]-nums[0]));\n    }\n};\n```\n- Notice from the code that we do not actually need to change the values, we just need to compare the elements of interest by the three options.\n#### If this helped please leave an upvote. Thanks!
['C++', 'Java', 'Python3']