Given k sorted arrays, select one element from each array such that the difference of maximum element and minimum element of the selected elements is minimum. Example for k
May be you are looking for this answer : https://www.geeksforgeeks.org/find-smallest-range-containing-elements-from-k-lists/ .
It's not contributed to me, I just found this on geeksforgeeks while searching for the same thing as you.