Max Min Discussions | | HackerRank

Max Min

  • + 0 comments

    python 3

    def maxMin(k, arr):
            arr.sort()
            return min([arr[i+k-1]-arr[i] for i in range(len(arr) - k +1)])