I am thinking about crypt kicker problem. I think I can solve it by brute-force trying all permutations of the letters (perhaps with some optimizations). However the worst-case complexity of this solutions looks like O(permutations of alphabet * number of words).
Is it correct? Is there a solution with less complexity in the worst case?
Here’s a formal proof of NP-hardness of Crypt Kicker with a k-letter alphabet, by reduction from 3-dimensional matching.
For each input triple (x, y, z), put the word xyz in the dictionary. To determine whether there exists a matching of size n, request a decryption of an n-word ciphertext abc def ghi … . Clearly this reduction is poly-time. If there exists a 3-d matching (x1, y1, z1), …, (xn, yn, zn), then the permutation x1→a, y1→b, z1→c, x2→d, … witnesses the existence of a valid decryption. Conversely, if there exists a valid decryption permutation π, then we recover a 3-d matching (π(a), π(b), π(c)), (π(d), π(e), π(f)), … .