You are given an array A of N integers in nondecreasing order. Remove K integers such that the maximum difference between two consecutive elements is minimized.
Assume that the last and the first elements are fixed and they cant be removed .
example:
n = 5
arr = [1 2 3 7 8]
k = 2
ans : 5
Anyone plz gives solution.