Following the first problem, now you need to find the shortest path. Given two jugs with capacities A and B, find the minimum number of steps to get exactly T units in either jug. You can Fill, Empty or Pour.
- input: A, B, T
- output: n (minimum steps) or -1 if impossible
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers4
Suggested Problems
-
Two Jugs: Minimum Steps ( Medium )
4 Solvers
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!