Say I have a bunch of string pairs, representing "before" and "after" values. To give a simple example:
aaaabbbb -> aabbbbaa
abbbbbbb -> bbbbbbab
aaabbbaa -> abbbaaaa
cccccccc -> cccccccc
How would I determine that one possible permutation could be [ 6, 7, 0, 1, 2, 3, 4, 5 ], or in other words, all the characters were rotated left by two spaces?
Is there some literature on this problem? Also, would there be the concept of a "most likely" permutation, if some pairs in the list don't match up precisely? Could more complicate permutations be found, other than shifting left and right?