C++ | Simple solution
\nclass Solution {\npublic:\n    int minimumDifference(vector<int>& nums, int k) {\n        int l = nums.size();\n        if(l==1) return 0;\n        sort(nums.
```\nclass Solution {\npublic:\n    int minimumDifference(vector<int>& nums, int k) {\n        int l = nums.size();\n        if(l==1) return 0;\n        sort(nums.begin(), nums.end());\n        int i=0, m = INT_MAX,p;\n        while((i<l)&&(i+k-1 <l)){\n            p = nums[i+k-1]-nums[i];\n            m = min(m,p);\n            i++;\n        }\n        return m;\n    }\n};\n```
['C']