Given an array of integers size N, how can you efficiently find a subset of size K with elements that are closest to each other?
Le
After sorting, we can be sure that, if x1, x2, ... xk are the solution, then x1, x2, ... xk are contiguous elements, right?
So,