c++ | easy | short
\n# Code\n\nclass Solution {\npublic:\n  int minDifference(vector<int>& nums) {\n\tint n = nums.size();\n    if(n < 5)\n\t\treturn 0;\n\tpartial_sort(nums.begin
\n# Code\n```\nclass Solution {\npublic:\n  int minDifference(vector<int>& nums) {\n\tint n = nums.size();\n    if(n < 5)\n\t\treturn 0;\n\tpartial_sort(nums.begin(), nums.begin() + 4, nums.end());\n    partial_sort(nums.rbegin(), nums.rbegin() + 4, nums.rend(), greater<int>());\n\t\n\tint min_diff = INT_MAX;\n\tfor(int i = 0, j = n - 4; i < 4; ++i, ++j)\n\t\tmin_diff = min(min_diff, nums[j] - nums[i]);\n        \n\treturn min_diff;\n}\n};\n```
['C++']