Solution to 019 in Go