Speeding up a script -- looking for ideas
tjreedy at udel.edu
Sun Oct 20 16:43:44 CEST 2002
"Richard Bow" <donkan7 at yahoo.com> wrote in message
news:Xns92ADE4723B46donkansevenyahoocom at 220.127.116.11...
> I'm hoping to get some hints for significantly speeding up the below
First, precalculate a list of cubes instead of cubing over and over.
Next, calculate sums within particular range (small enough to not
Store as dict(sum) = (a,b) or list.append( (sum, a, b)).
If dict, easy to spot duplicate sums.
If list, sort and scan for dups.
Terry J. Reedy
More information about the Python-list