The string 2123132133
has the property that no subsequence of length 3 is the same as any other subsequence of length 3.
Your task is to build a program that will output as long of a string as possible that satisfies this property for sequences of length 9 with the characters from 1
to 9
.
The source code of your program may not be longer than 16 kilobytes (16,384 bytes). The program that wins is the one that outputs the longest sequence of digits from 1
to 9
such that no subsequence of 9 digits is the same.
while(1){putchar('1'+rand()%9);}
submission that just spews random digits forever and it could be argued that its output will contain (given enough time) "the longest sequence of digits from 1 to 9 such that no subsequence of 9 digits is the same." That would be a dick move, for sure, but easily prevented. Cheers. \$\endgroup\$