Java Easy 4 lines solution
\n Add your space complexity here, e.g. O(n) \n\n# Code\n\nclass Solution {\n    public int minimumDifference(int[] nums, int k) {\n        \n        Arrays.sor
\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int minimumDifference(int[] nums, int k) {\n        \n        Arrays.sort(nums);\n        int diff = nums[k-1]-nums[0];\n        for(int i=k;i<nums.length;i++){\n            diff = Math.min(nums[i]-nums[i-k+1],diff);\n        }\n        return diff;\n    }\n}\n```
['Sorting', 'Java']