1 comment

[ 3.6 ms ] story [ 15.0 ms ] thread
This is inspired by last night's post to HN of the Goats, Wolves and Lions problem: https://news.ycombinator.com/item?id=7855455 .

I and others noticed that the javascript solution posted was far from optimal. So for fun, I tried optimizing both it and the algorithm used. The end result runs almost 20,000 times faster and handily beats all implementations in the original post, including the carefully optimized C++11 one by almost 1000x.

As I say in the gist: it's still about the algorithm, not the language.