Solve problem 41 using Go.