Simple java solution
\n# Complexity\n- Time complexity: O(n log n)\n\n- Space complexity: O(1)\n\n# Code\n\nclass Solution {\n    public int minimizeSum(int[] nums) {\n        Array
\n# Complexity\n- Time complexity: $$O(n log n)$$\n\n- Space complexity: $$O(1)$$\n\n# Code\n```\nclass Solution {\n    public int minimizeSum(int[] nums) {\n        Arrays.sort(nums);\n        int a=nums[nums.length-1]-nums[0];\n        int b=nums[nums.length-1]-nums[2];\n        int c=nums[nums.length-3]-nums[0];\n        int d=nums[nums.length-2]-nums[1];\n        return Math.min(a,Math.min(b,Math.min(c,d)));\n    }\n}\n```
['Sorting', 'Java']