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
1 Comment
Solution Comments
Show comments
Loading...
Problem Recent Solvers53
Suggested Problems
-
Two Jugs: Minimum Steps ( Medium )
53 Solvers
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!
how is it gonna viral ?_?