Josh Coates wrote:
We are looking for sequences of n > 0 integers where the absolute values of
the differences of successive elements are included in the set of numbers 1
through n - 1. For instance,

Just out of curiosity, which of the following lines match?
0
1
1000000

The input adheres to n > 0 integers. There is no previous element to compare against so should one assume undefined or 0? Undefined should never be a match, while 0 would be a match only for the first line. Perhaps the best solution would be to look for sequences of n > 1?

Derek

/*
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