- Solution for problem 2 in Go