$10K coding deathmatch

Derek derek at burdick.cc
Fri Nov 3 16:51:03 MST 2006


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



More information about the PLUG mailing list