Python O(nlogn) solution || sort first
\nclass Solution:\n    def minimumDifference(self, nums: List[int], k: int) -> int:\n     \n        n = len(nums)\n        nums.sort()\n        minv = nums[-1]-
```\nclass Solution:\n    def minimumDifference(self, nums: List[int], k: int) -> int:\n     \n        n = len(nums)\n        nums.sort()\n        minv = nums[-1]-nums[0]\n        for i in range(n-k+1):\n            minv = min(minv, nums[i+k-1]-nums[i])\n        return minv\n```
['Sorting', 'Python', 'Python3']