Solve problem 30 using Go.