$10K coding deathmatch

Shane Hathaway shane at hathawaymix.org
Thu Nov 2 15:30:02 MST 2006


Andy Bradford wrote:
> So, your first example:
> 
> 4 1 2 3
> 
> Would have resulted in { 3 1 1 } but since 3 was not in { 4 1 2 }, I was
> getting no match. Of  course when matching against { 1 2 3  } there is a
> match.

Eh?  I'm not sure you understand the problem correctly.

The problem is just asking whether successive elements vary more than a
certain amount, where the maximum variance is one less than the number
of elements in the sequence.  "4 1 2 3" matches because no successive
elements vary by more than 3, where 3 is the number of elements minus
one.  "8 6 2" does not match because the difference between 6 and 2 is
too large.

Shane




More information about the PLUG mailing list