Solution for 005 in Go