You are viewing a single comment's thread. Return to all comments →
def maxMin(k, arr): return min(map(lambda x, y: abs(x - y), sorted(arr)[:-k + 1], sorted(arr)[k - 1:]))
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 →
def maxMin(k, arr): return min(map(lambda x, y: abs(x - y), sorted(arr)[:-k + 1], sorted(arr)[k - 1:]))