TC CDPlayer


 * http://www.topcoder.com/stat?c=problem_statement&pm=7476

Summary
In the problem, they describe a mechanism for putting a CD player on "random shuffle" mode. You need to determine if a given string could represent the order of songs played.

From TopCoder Single Round Match 343.

Hints

 * Guess the first time that the CD finishes a "round" of shuffling.