On 03/13/2006 01:06 PM, Jonathan Ellis wrote:
On Mon, 13 Mar 2006 12:33:48 -0700, "Bryan Sant" <[EMAIL PROTECTED]>
said:

Python 2.4.2 (bad algorithm?)
------
LOC: 6
Best Time: 31.724
Worst Time: 32.417
Avg. Time:  31.98
...
Ouch.  Yeah, Tyler's python code is pretty screwed up.  (Ab)using list
comprehensions like that means you materialize the whole data set into
memory, and using a list for lookup instead of a dict is going to cause
efficiency problems.  Here's my quick-and-dirty version.

Yeah, yeah... I do admit I was abusing list comprehensions just a little bit... :)

With my submission, I was looking more at lines of code than effeciency. I'm not sure why it wasn't producing accurate output, though... I'll have to look into that.

Note: I would never write code like that for anything but a LOC-minimizing contest. My real code would have looked more like what Jonathan wrote.

--Tyler

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to