In order to determine the distance traveled by the dog in the two times, consider:
In the second time the dog goes and comes back for a distance of 18 m, that is, the total distance is 18m + 18m = 36 m
In the first time the dog goes and comes back for a distance of 23 m, that is, the total distance is 23m + 23m = 46 m
Hence, for the two times the distance traveled by the dog is:
46m + 36m = 82m