🔴 Riddle #211 of 240
You have a 9-litre jug and a 4-litre jug, both unmarked, plus a tap and a drain. How do you measure exactly 7 litres, and what is the fewest number of moves (fills, empties and pours) it takes?
Think about it first. When you're ready:
10 moves
A breadth-first search over all fill, empty and pour states finds 10 moves as the fewest needed for 7 litres.