It’s not as easy as you think. It’s also not as hard as you think. In any case, it’s my favorite kind of algorithms writing: Smart, lots of examples, lucid, and fun—plus a Python coda.
And we’re all following Frederick Akalin’s programming weblog, right? OK. Just wanted to make sure we were all on the same page.
With that in mind, you should be able to solve the first question to the 2010 Greplin Programming Challenge.