easy understand
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n# Code\n```\nclass Solution {\npublic:\n    int minimizeSum(vector<int>& nums) {\n        int max1 = INT_MIN, max2 = INT_MIN, max3 = INT_MIN, min1 = INT_MAX, min2 = INT_MAX, min3 = INT_MAX;\n        for (auto num : nums) {\n            if (max1 < num) {\n                max3 = max2;\n                max2 = max1;\n                max1 = num;\n            }\n            else if (max2 < num) {\n                max3 = max2;\n                max2 = num;\n            }\n            else if (max3 < num) {\n                max3 = num;\n            }\n\n            if (min1 > num) {\n                min3 = min2;\n                min2 = min1;\n                min1 = num;\n            }\n            else if (min2 > num) {\n                min3 = min2;\n                min2 = num;\n            }\n            else if (min3 > num) {\n                min3 = num;\n            }\n        }\n\n        // case1 change two max nums\n        int ans1 = max3 - min1;\n        // case2 change two min nums\n        int ans2 = max1 - min3;\n        // case3 change one max num and one min num\n        int ans3 = max2 - min2;\n        int ans = min(ans1, ans2);\n        ans = min(ans, ans3);\n\n        return ans;\n    }\n};\n```
['C++']