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


/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to