1984. Minimum Difference Between Highest and Lowest of K Scores
https://leetcode.com/problems/minimum-difference-between-highest-and-lowest-of-k-scores
Description
You are given a 0-indexed integer array nums
, where nums[i]
represents the score of the ith
student. You are also given an integer k
.
Pick the scores of any k
students from the array so that the difference between the highest and the lowest of the k
scores is minimized.
Return the minimum possible difference.
Example 1:
Example 2:
Constraints:
1 <= k <= nums.length <= 1000
0 <= nums[i] <= 105
ac
Previous1983. Widest Pair of Indices With Equal Range SumNext1985. Find the Kth Largest Integer in the Array
Last updated