🔥 🔥🔥 JavaScript, easy to understand, faster than 94% Sliding Window 🔥 🔥🔥
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: O(nlogn)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(logn)\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    if(nums.length === 1) return 0\n\n    let difference = Infinity\n    nums.sort((a,b) => a - b)\n\n    let start = 0\n    let end = k - 1\n    while(end < nums.length) {\n        difference = Math.min(difference, nums[end] - nums[start])\n        start++\n        end++\n    }\n\n    return difference\n};\n```
['Sliding Window', 'JavaScript']