O(n)
We can always make the low score zero. Therefore, we should focus on reducing the high score.\n\nFor that, we can either remove two smallest, one smallest and o
We can always make the low score zero. Therefore, we should focus on reducing the high score.\n\nFor that, we can either remove two smallest, one smallest and one largest, or two largest elements.\n\nWe use partial sort to find two largest and two smallest elements, so that the time complexity is O(n).\n\n**C++**\n```cpp\nint minimizeSum(vector<int>& n) {\n    partial_sort(begin(n), begin(n) + 3, end(n));\n    partial_sort(rbegin(n), rbegin(n) + 3, rend(n) - 3, greater{});\n    return min({ n[n.size() - 3] - n[0],\n                 n[n.size() - 2] - n[1], \n                 n[n.size() - 1] - n[2] });\n}\n```
['C']