Fixed problem #3 in Go
Small optimization of problem #5 in Go