Here it is, my solution. From mathematical and algorithmic point of
view, you won't find anything new.Kero, this is really the quickest solution so far, passing my little
test suite. Before you, Ryan Sobol, was the leader, clocking in at 2.376
secs with #60.20 on the Quiz list. Your #60.22, clocks in at 1.972
seconds, a decrease by 17%.I'm challenging every quizzer: There is more to fetch!
You don't say? You do 868056 -> 651040 in 76 seconds. I broke my program off
after 15 minutes. I can not accept the title of fastest solution.
However, I need 21 seconds for 868056 -> 27 so I would assume that searching
for prefixes, or the approach from two sides has lots of potential.
By refactoring Kero's code, I was able to squeeze the execution time to
0.37 seconds, that's another 80%.
Did you do other things than eliminating method calls?
I'm not submitting this code, as I'm sure there are more improvements to
be done.
If you did other things, I'd be interested to see it, still. My mail address
is mangled,
"kero@chello.single-dot.nl".split(/\./).values_at(0,2).join(".")
Thanks.
