simple cpp solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int minimumDifference(vector<int>& nums, int k) {\n        sort(nums.begin(),nums.end());\n        if(nums.size()==1)return 0;\n        int ans=INT_MAX;\n        for(int i=0;i<=nums.size()-k;i++)\n        {\n            ans=min(nums[i+k-1]-nums[i],ans);\n        }\n        return ans;\n    }\n};\n```
['Array', 'C++']