Solution to Code Jam 2012 Question in Go