Measuring two pints
You have a -pint and an -pint vessel and an unlimited water source. You must end with exactly pints in a vessel. A single "transaction" is filling a vessel to the top, emptying a vessel completely, or pouring one vessel into the other until the source is empty or the destination is full. What is the minimum number of transactions needed?
Show hints (2)+
- Model states and do a breadth-first search; each fill/empty/pour is one transaction.
- The shortest path to a vessel holding takes moves.
Answer
Reveal answer →Final answer
14
Create a free account to see the full worked solution and track your progress.
Interview format: Market Maker, Numerical Reasoning Tests