Problem-2 in Go