X
It is now four years since I first asked for support, and I would like to sincerely thank everyone who has helped me. BrainBashers doesn't show adverts, and I continue to depend on the ongoing support from everyone who enjoys the site.
support BrainBashers
Answer
Here are the contents of the containers after each stage:
A B
0 7 fill B
3 4 fill A from B
0 4 empty A
3 1 fill A from B
0 1 empty A
1 0 fill A from B
1 7 fill B
3 5 fill A from B
This leaves 5 gallons in container B after 8 steps.