[Golang] Simple solution
Complexity\n- Time complexity: O(N Log N)\n- Space complexity: O(1)\n\n# Code\n\nfunc minimizeSum(nums []int) int {\n  sort.Ints(nums)\n  n := len(nums)\n  // S
# Complexity\n- Time complexity: O(N Log N)\n- Space complexity: O(1)\n\n# Code\n```\nfunc minimizeSum(nums []int) int {\n  sort.Ints(nums)\n  n := len(nums)\n  // Since we can only make at most 2 modifications\n  // We either change the first two elements, last two elements\n  // or the first and last element.\n  res := nums[n-3] - nums[0]\n  if nums[n-2] - nums[1] < res {\n    res = nums[n-2] - nums[1]\n  }\n  if nums[n-1] - nums[2] < res {\n    res = nums[n-1] - nums[2]\n  }\n  return res\n}\n\nfunc abs(a int) int {\n  if a < 0 {\n    return -a\n  }\n  return a\n}\n```
['Sorting', 'Go']