##
Chose k array elements such that difference of maximum and minimum is minimized
January 16, 2017

Given an array of n integers and a positive number k. We are allowed to take any k integers from the given array. The task is to find the minimum possible value of the difference between maximum and minimum of K numbers. Examples: Input : arr[] = {10, 100, 300, 200, 1000, 20, 30} k… Read More »