You are given an integer array nums (test scores) and an integer k. Pick any k scores from the array. Return the minimum possible difference between the highest and lowest of the picked scores.
Input: An integer array nums and an integer k.
Output: Integer — minimum (max - min) among any k chosen scores.
Input: [90],1
Output: 0
Explanation: Pick [90]. max-min=0.Input: [9,4,1,7],2
Output: 2
Explanation: Sort: [1,4,7,9]. Best window of 2: [7,9]→2 or [1,4-1=3? No [4,7]→3,[7,9]→2. Min=2.Input: [87038,55569],2
Output: 31469
Explanation: Only one window of 2. 87038-55569=31469.1<=nums.length<=10000<=nums[i]<=10^51<=k<=nums.length