C++ || EASY TO UNDERSTAND || Simple Solution || Commented
\nclass Solution {\npublic:\n    int minDifference(vector<int>& nums) {\n        int n=nums.size();\n        if(n<=4)\n        return 0;\n        sort(nums.begi
```\nclass Solution {\npublic:\n    int minDifference(vector<int>& nums) {\n        int n=nums.size();\n        if(n<=4)\n        return 0;\n        sort(nums.begin(),nums.end());\n        //changing first second and third smallest to next smallest\n        int res=nums[n-1]-nums[3];\n        //changing last three greatest numbers\n        res=min(res,nums[n-4]-nums[0]);\n        //changing 2 smallest+1 greatest\n        res=min(res,nums[n-2]-nums[2]);\n        //changing 2 greatest+ 1 smallest;\n        res=min(res,nums[n-3]-nums[1]);\n        return res;\n    }\n};\n```\n**Please upvote to motivate me in my quest of documenting all leetcode solutions(to help the community). HAPPY CODING:)\nAny suggestions and improvements are always welcome**
[]