Solve the classic water jug riddle! Use two jugs with different capacities to measure an exact amount of water.
Enter values and click "Solve Puzzle" to see the visualization
A solution exists if and only if the target amount Z is divisible by the Greatest Common Divisor (GCD) of the two jug capacities X and Y.
We use Breadth-First Search (BFS) to find the shortest sequence of operations that leads to the target amount.