Python3
\nclass Solution:\n    def minimumDifference(self, nums: List[int], k: int) -> int:\n        a=float(\'inf\')\n        s=[]\n        b=sorted(nums)\n        for
```\nclass Solution:\n    def minimumDifference(self, nums: List[int], k: int) -> int:\n        a=float(\'inf\')\n        s=[]\n        b=sorted(nums)\n        for i in range(k-1,len(b)):\n            if b[i]-b[i-k+1]<a:\n                s.append(b[i]-b[i-k+1])\n        return min(s)\n```
[]