Java | 0ms | Efficient Solution | Using Sliding Window
class Solution {\n    public int minimumDifference(int[] nums, int k) {\n        \n        \n        //Sliding Window\n        \n        if(nums.length == 1)\n 
class Solution {\n    public int minimumDifference(int[] nums, int k) {\n        \n        \n        //Sliding Window\n        \n        if(nums.length == 1)\n            return 0;\n        \n        Arrays.sort(nums);\n        \n        int diff = Integer.MAX_VALUE;\n        \n        for(int i = k - 1; i < nums.length; ++i){\n            \n            diff = Math.min(diff, nums[i] - nums[i - k  + 1]);\n            \n        }\n        \n        \n        return diff;\n        \n    }\n}
['Sliding Window', 'Java']