George Sakkis:
> A faster algorithm is to create a 'key' for each word, defined as the
> tuple of ord differences (modulo 26) of consecutive characters.

Very nice solution, it uses the same strategy used to find anagrams,
where keys are
"".join(sorted(word))
Such general strategy to look for a possible invariant key for the
subsets of the required solutions is quite useful.

Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to