Usually, the target T must be in one jug. In this version, the target T is the sum of water in all N jugs.
  • Example: C = [3,5], T = 2. Output: 3 steps
  • Path (0,0) -> (0,5) -> (3,2) -> (0,2). Total is 0 + 2 = 2.

Solution Stats

6 Solutions

3 Solvers

Last Solution submitted on Feb 19, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers3

Suggested Problems

More from this Author9

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!