4 ms·
I’ve seen a couple articles about this problem but never quite understood what the difference was between it and simply the number of permutations. This paragra
by koolba 8y ago
I’ve seen a couple articles about this problem but never quite understood what the difference was between it and simply the number of permutations. This paragraph from the article does a great job (finally!) show casing it in an example:
> If a television series has just three episodes, there are six possible orders in which to view them: 123, 132, 213, 231, 312 and 321. You could string these six sequences together to give a list of 18 episodes that includes every ordering, but there’s a much more efficient way to do it: 123121321.
Rephrasing it a bit, the problem is generating the shortest string of tokens (with repetition of the N tokens) in which every possible permutation of those N tokens is a substring.