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

17 Solutions

11 Solvers

Last Solution submitted on May 01, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers11

Suggested Problems

More from this Author20

Problem Tags

Community Treasure Hunt

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

Start Hunting!