Simplest C++ solution. Easy to understand.
\nclass Solution {\npublic:\n    int minimumDifference(vector<int>& nums, int k)\n    {\n        int ans = INT_MAX;\n        sort(nums.begin(),nums.end());\n   
```\nclass Solution {\npublic:\n    int minimumDifference(vector<int>& nums, int k)\n    {\n        int ans = INT_MAX;\n        sort(nums.begin(),nums.end());\n        \n        for(int i=0;i<=nums.size()-k;i++)\n        {\n            ans = min(ans,nums[i+(k-1)] - nums[i]);\n        }\n        return ans;\n    }\n};\n```\n**Like the solution?\nPlease upvote \u30C4**\n\nIf you can\'t understand any step/point, feel free to comment.\nHappy to help
['C']