Chop chopper
IntuitionApproachComplexity

Time complexity:
O(nlog(n))


Space complexity:
O(1)

Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
O(nlog(n))

- Space complexity:
O(1)

# Code
```javascript []
/**
 * @param {number[]} nums
 * @return {number}
 */
var minimizeSum = function (nums) {
  if (nums.length <= 3) {
    return 0;
  }
  nums.sort((a, b) => a - b);
  return Math.min(
    nums[nums.length - 1] - nums[2],
    nums[nums.length - 3] - nums[0],
    nums[nums.length - 2] - nums[1]
  );
};
```
['JavaScript']