You are viewing a single comment's thread. Return to all comments →
def maxMin(k, arr): arr.sort() min_unfairness = arr[-1] - arr[0] for i in range(len(arr)-k+1): unfairness = arr[k+i-1] - arr[i] if unfairness < min_unfairness: min_unfairness = unfairness return min_unfairness
Seems like cookies are disabled on this browser, please enable them to open this website
Max Min
You are viewing a single comment's thread. Return to all comments →