# \$10K coding deathmatch

Shane Hathaway shane at hathawaymix.org
Thu Nov 2 16:34:45 MST 2006

```Andy Bradford wrote:
> Doesn't this say  to check the absolute value of  the difference between
> two numbers in a sequence against a set of numbers 1, ... n-1? I suppose
> one could infer that this is a  test for the maximum variance of any two
> integers in the sequence against one less than the number of elements in
> the sequence and  1, but then why  bother calling it a set  of numbers 1
> through n-1?

Josh's explanation is mathematically precise and concise, but not easy
to grasp without reading it over a couple of times.  Some imprecise
inference often helps.

> We are  looking for  sequences with  n > 0  elements where  the absolute
> values of  the differences of  successive elements  are all less  than n
> elements - 1 and greater than 1?
>
> Thus, in his original example:
>
> 4 1 2 3
>
> Tests would be  made for 3, 1 and finally  1 against the set { 1 2 3 },
> right?

Yes.

Shane

```