add-a-gram

Jason Orendorff jason at jorendorff.com
Tue Feb 19 22:14:13 EST 2002


Jason wrote:
> Here is a puzzle that was floating around comp.lang.lisp, and I was
> wondering what a Python solution would be.

I solved this in Python in a few minutes, then converted it to C++
for efficiency and found that it ran slower in C++ (because I used
map<> and string.  Python's stuff is more efficient.)

Then I wrote my own hashtable and my own string type and managed
to get the C++ down to about 8x faster than the Python.
It solves their WORD.LST in <1 second on my PC.

I solved the other puzzles too...  They still didn't hire me.  :)

## Jason Orendorff    http://www.jorendorff.com/




More information about the Python-list mailing list