note
tilly
I think the "search-for" number is a misunderstanding on
your part. We are not looking for the number that is
closest to the first. We are looking for the pair of
numbers, out of all n choose 2 pairs, which are closest
together.<P>
So given (1, 5, 7) it would return (5, 7) (or (7, 5)) while (1, 5, 11) would return (1, 5). And you cannot assume that it is presented in increasing order.
69570
69818