Ask HN: how do people solve the 3 Google Code Jam problems in 25 minutes?

https://news.ycombinator.com/item?id=801835
by Tichy • 17 years ago
40 27 17 years ago

If I read it correctly, the leader of the scoreboard submitted the solution for problem A in 7 minutes, problem B 11 minutes later, problem C 7 minutes later. (see http://code.google.com/codejam/contest/scoreboard?c=90101#)

I was expecting some people to be way, way faster than me, but that seems stunning. Can't wait to see what programming language they used.

Me, I tried to solve the problems in Ruby. I am not that experienced with Ruby, so I lost a lot of time debugging. My solution for problem A was too slow in Ruby 1.8 (only 8 minutes are allowed for computation) and only barely made it with Ruby 1.9 - Google Q&A claimed it should be doable in less 8 minutes with Ruby 1.8, though.

In general I had no problems thinking of an algorithm (except maybe some really clever optimization), but I can't imagine coding them in 7 minutes. My solution for problem B is 93 lines long - even just typing it might take longer than 7 minutes...

I did not practice at all - perhaps with more practice of the typical class of problems for such competitions, it becomes more of a copy+paste thing?

Related Stories

Loading related stories...

Source preview

news.ycombinator.com