Simple Java Solution
Code\njava []\nclass Solution {\n    public int minimizeSum(int[] nums) {\n        Arrays.sort(nums);\n        if(nums.length==3)\n        {\n            return
# Code\n```java []\nclass Solution {\n    public int minimizeSum(int[] nums) {\n        Arrays.sort(nums);\n        if(nums.length==3)\n        {\n            return 0;\n        }\n        int min=nums[nums.length-1]-nums[2];\n        if(nums[nums.length-2]-nums[1]<min)\n        {\n            min=nums[nums.length-2]-nums[1];\n        }\n        if(nums[nums.length-3]-nums[0]<min)\n        {\n            min=nums[nums.length-3]-nums[0];\n        }\n\n        return min;\n    }\n}\n```
['Java']