TAOCP 7.2.2.1 Exercise 92

Solution to TAOCP 7.2.2.1 Exercise 92.

Section 7.2.2.1: Dancing Links

Exercise 92. [22] [22] Some $p$-word cycles define two-way word stairs that have $3p$ distinct words:

$$ \begin{array}{ccccc} \texttt{R A P I D} & & & & \texttt{R A P I D} \ \texttt{L A T E D} & & & & \texttt{R A T E D} \ \texttt{L A C E S} & & & & \texttt{L A C E S} \ \texttt{R O B E S} & & & & \texttt{L A C E S} \ \texttt{R A P I D} & & & & \texttt{R A P I D} \ \texttt{L A T E D} & & & & \texttt{R A T E D} \ \texttt{L A C E S} & p = 4 & & & \texttt{L A C E S} \ \texttt{R O B E S} & & & & \texttt{R O B E S} \ \texttt{R A P I D} & & & & \texttt{R A P I D} \end{array} $$

What are the best five-letter examples of this variety, for $1 \le p \le 10$?

Verified: no
Solve time: 3m23s