# Minimum Difference Between Highest and Lowest of K Scores (Leetcode 1984)

Problem Link: <https://leetcode.com/problems/minimum-difference-between-highest-and-lowest-of-k-scores/>

```python
class Solution:
    def minimumDifference(self, nums: List[int], k: int) -> int:
        
        nums.sort()
        n=len(nums)
        ans=float('inf')
        for i in range(n-k+1):
            ans=min(ans,nums[i+k-1]-nums[i])
        return ans
```
