You are viewing a single comment's thread. Return to all comments →
c#
public static int maxMin(int k, List arr)
{ arr.Sort(); List<int> unfairness = new List<int>(); for (int i = 0; i <= arr.Count - k; i++) { unfairness.Add(arr[i+k-1]-arr[i]); } unfairness.Sort(); return unfairness[0]; }
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 →
c#
public static int maxMin(int k, List arr)