Simple python solution | sliding window ✅
IntuitionTo solve with sliding windowComplexity

Time complexity: O(N Log N)


Space complexity: O(1)

Code
# Intuition
To solve with sliding window

# Complexity
- Time complexity: O(N Log N)

- Space complexity: O(1)

# Code
```python3 []
class Solution:
    def minimumDifference(self, nums: list[int], k: int) -> int:
        
        L,R,min_v=0,k-1,float('inf')
        nums.sort()
        
        while R < len(nums):
            min_v = min(min_v, abs(nums[L] - nums[R]))
            R += 1
            L += 1
         
        return min_v
```
['Array', 'Sliding Window', 'Sorting', 'Python3']