Simple Soltuion || Sliding Window || Sort || Javascript
\n\n/*\n * @param {number[]} nums\n * @param {number} k\n * @return {number}\n /\nvar minimumDifference = function(nums, k) {\n    nums.sort((a,b)=>a-b)\n    le
```\n\n```/**\n * @param {number[]} nums\n * @param {number} k\n * @return {number}\n */\nvar minimumDifference = function(nums, k) {\n    nums.sort((a,b)=>a-b)\n    let min=nums[0],max=nums[k-1],diff=max-min\n    for(let i=k;i<nums.length;i++){\n        diff=Math.min(diff,nums[i]-nums[i-k+1])\n    }\n    return diff\n};``
['Sliding Window', 'Sorting', 'JavaScript']