This is already a post from comp.lang.prolog and
stackoverflow. But it seems it is reasonably challenging
and could be fun. So I am also crossposting here.
I want to watch 6 episodes of “friends” in all
possible permutations. How can I arrange the
episodes in one string so that the substrings
of length 6 cover all permutations? What are
the shortest such strings? What would be the
Prolog code for that?
See also: