simple and easy C++ solution with explanation 😍❤️‍🔥
if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n\n\n# Code\n\nclass Solution {\npublic:\n    int minDifference(vector<int>& nums) \n    {\n        if(nums.s
# if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n\n\n# Code\n```\nclass Solution {\npublic:\n    int minDifference(vector<int>& nums) \n    {\n        if(nums.size() <= 3) return 0;\n        sort(begin(nums), end(nums));\n\n        int ans = INT_MAX, n = nums.size();\n\n        // frist three remove\n        ans = min(ans, nums.back() - nums[3]);\n\n        // last three remove\n        ans = min(ans, nums[n-4] - nums[0]);\n\n        // first 2 remove, last 1 remove\n        ans = min(ans, nums[n-2] - nums[2]);\n\n        // first 1 remove, last 2 remove\n        ans = min(ans, nums[n-3] - nums[1]);\n\n        return ans;\n    }\n};\n```
['Array', 'Greedy', 'Sorting', 'C++']