Max Min Discussions | | HackerRank

Max Min

  • + 0 comments
    def maxMin(k, arr):
        x = sorted(arr)
        return min([x[i+k-1] - x[i] for i in range(len(arr) - k + 1)])