Problem 1-3 solved with Go