c++ sliding window
class Solution {\npublic:\n\n    int minimumDifference(vector& nums, int k) {\n        sort(nums.begin(),nums.end());\n        int mx=INT_MAX;\n        int i=0,
class Solution {\npublic:\n\n    int minimumDifference(vector<int>& nums, int k) {\n        sort(nums.begin(),nums.end());\n        int mx=INT_MAX;\n        int i=0,j=0;\n        while(j<nums.size())\n        {\n            if(j-i+1<k)\n                j++;\n            if(j-i+1==k)\n            {\n                mx=min(mx,nums[j]-nums[i]);\n                i++;\n                j++;\n            }\n        }\n        return mx;\n        \n        \n    }\n};
['C', 'Sliding Window']