Java sorting detailed solution
class Solution {\n    public int minimizeSum(int[] nums) {\n        int n=nums.length;\n        Arrays.sort(nums);\n        //Remove first and last elem\n      
# class Solution {\n    public int minimizeSum(int[] nums) {\n        int n=nums.length;\n        Arrays.sort(nums);\n        //Remove first and last elem\n        int a=nums[n-2]-nums[1];\n        //Remove first two elements\n        int b=nums[n-1]-nums[2];\n        //Remove last two elements\n        int c=nums[n-3]-nums[0];\n        //return minimum of all\n        return Math.min(a,Math.min(b,c));\n    }\n}
['Sorting', 'Java']