Simple 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```\n/**\n * @param {number[]} nums\n * @param {number} k\n * @return {number}\n */\nvar minimumDifference = function(nums, k) {\n    \n  if(nums.length==1) return 0\n\n  nums.sort((a,b)=>a-b)\n   let start=0,end=k-1,diffrence=nums[nums.length-1];\n  while(end<nums.length){\n      diffrence=Math.min(nums[end]-nums[start],diffrence)\n      start++\n      end++\n  }\n    return diffrence\n};\n```
['JavaScript']