Easy and Short 5 line of code With Explanation
Steps``\n1. First we sort the array in increasing order.\n2. Now we consider every window of size k .\n3. in each window we find difference between Max and Min 
* **Steps**``\n1. First we sort the array in increasing order.\n2. Now we consider every window of size k .\n3. in each window we find difference between Max and Min element,\n4. we return our Minimum difference  of all the vlaues in step 3.\n**Code**\n\'\'\'\n    int minimumDifference(vector<int>& nums, int k) {\n        sort(nums.begin(),nums.end());\n        int n=nums.size(),res=INT_MAX;\n        for(int i=0;i<=n-k;i++){\n            res=min(res,nums[i+k-1]-nums[i]);\n            \n        }\n        return res;\n        \n        \n    }\n\'\'\'\nI hope you will get my solution. if you have any doubt please comment . \n\n
['C', 'Sliding Window', 'Sorting', 'C++']