Python | Sliding Window | O(nlogn)
```\nclass Solution:\n    def minimumDifference(self, nums: List[int], k: int) -> int:\n        nums.sort()\n        cur = float(\'inf\')\n        for i in rang
```\nclass Solution:\n    def minimumDifference(self, nums: List[int], k: int) -> int:\n        nums.sort()\n        cur = float(\'inf\')\n        for i in range(len(nums)-k+1):\n            cur = min(cur, nums[i+k-1]-nums[i])\n
['Python']