Solution for 006 in Go