Python | Sort |  2 Lines
\nclass Solution:\n    def minimumDifference(self, nums: List[int], k: int) -> int:\n        nums.sort()\n        return  min(nums[i+k-1] - nums[i] for i in ran
```\nclass Solution:\n    def minimumDifference(self, nums: List[int], k: int) -> int:\n        nums.sort()\n        return  min(nums[i+k-1] - nums[i] for i in range(len(nums) - k + 1))\n```\n\nMore readable 5 liner:\n\n```\nclass Solution:\n    def minimumDifference(self, nums: List[int], k: int) -> int:\n        nums.sort()\n        min_diff = float(\'inf\')\n        for i in range(len(nums) - k + 1):\n            min_diff = min(min_diff, nums[i+k-1] - nums[i])\n        return min_diff\n```
['Sorting', 'Python', 'Python3']