You are viewing a single comment's thread. Return to all comments →
Yo,the three-liner java
int unfairness = Integer.MAX_VALUE; Arrays.sort(a); for (int i = 0; i < n - k + 1; i++) if (a[i+k-1]-a[i]<unfairness) unfairness = a[i+k-1]-a[i];
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 →
Yo,the three-liner java