1984. Minimum Difference Between Highest and Lowest of K Scores

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 1984

class Solution:
    def minimumDifference(self, nums: List[int], k: int) -> int:
        nums.sort()
        return min(nums[i + k - 1] - nums[i] for i in range(len(nums) - k + 1))