C++ Sort ( m=min(m,nums[i+k-1]-nums[i]))
\nclass Solution {\npublic:\n    int minimumDifference(vector<int>& nums, int k) {\n        \n        sort(nums.begin(),nums.end());\n        int m=INT_MAX;\n  
```\nclass Solution {\npublic:\n    int minimumDifference(vector<int>& nums, int k) {\n        \n        sort(nums.begin(),nums.end());\n        int m=INT_MAX;\n        for(int i=0;i<=nums.size()-k;i++){\n            m=min(m,nums[i+k-1]-nums[i]);\n        }\n        return m;\n    }\n};\n```
[]