Python3 solutions
Solution 1:\n\nclass Solution:\n    def minimumDifference(self, nums: List[int], k: int) -> int:\n        nums.sort()\n        res = 100000\n        \n        f
**Solution 1:**\n```\nclass Solution:\n    def minimumDifference(self, nums: List[int], k: int) -> int:\n        nums.sort()\n        res = 100000\n        \n        for i in range(len(nums) - k + 1):\n            arr = nums[i:i + k]\n            res = min(res, arr[-1] - arr[0])\n            \n        return res\n```\n\n**Solution 2:**\n```\nclass Solution:\n    def minimumDifference(self, nums: List[int], k: int) -> int:\n        nums.sort()\n        arr = nums[:k]\n        res = arr[-1] - arr[0]\n        \n        for i in range(k, len(nums)):\n            arr.pop(0)\n            arr.append(nums[i])\n            res = min(res, arr[-1] - arr[0])\n            \n        return res\n```
['Python3']