## Quora Challenge

From: andrew cooke <andrew@...>

Date: Fri, 5 Mar 2010 09:49:43 -0300

I implemented this last night - it was an interesting problem
(required a bit more thinking than you might naively expect).
Currently it's taking 11 seconds to run, on a CPU that's likely faster
than the p4 mentioned in the question, so I am going to see if I can
improve it (I haven't profiled the code yet).

I don't want to give away any hints, but it was interesting to see the
compiler optimizer at work.  I purposefully avoided optimisations I
was pretty sure the compiler could do itself, and perhaps as a result
using -O3 gives a factor of 3 speedup.

http://www.quora.com/challenges

Andrew