I wonder what's the time complexity of the following selection problem I found while thinking of a string-matching problem.
[Assuming operations on integers take $O(1)$ time]
We are Given $m$ sets, with $n$ integer numbers each. We want to select exactly one integer from each set, to make a set S, such that $~ l = \max(S) - \min(S)~$ is minimized.
For example, n = 4, m = 3:
$S_1 = \{1, 43, 71, 101\}$
$S_2 = \{18, 53, 80, 107\}$
$S_3 = \{3, 16, 51, 208\}$
Now
$~S = \{43, 53, 51\}$
has one number from each set and
$~l = \max(S) - \min(S) = 53 - 43 = 10 ~$
wich is the minimum possible value of $l$ (I think).
First thing I tried was a reduction to the set cover problem, but I wasn't able to find one.