Question: I require a python code solution for the following problem. Others & I have asked previously but only provided sudo-code or provideded a completely wrong
I require a python code solution for the following problem. Others & I have asked previously but only provided sudo-code or provideded a completely wrong answer. "A modified version of the Die Hard 3 problem is using 2 jugs (4 gal and 3 gal) and a water faucet, how do we get exactly 2 gal in the 4 gal jug?
Hint: Use breadth first search with the 2 jugs with weights of 3 and 4.
As discussed in class, this problem can be solved using quite a few different approaches. Several of these approaches can be found on the internet complete with code, including the simple hard-coded solution to the specific problem (discussed in this assignment) to more general solutions using Breadth First Search and recursion!
So the problem can be treated as one of reverse engineering. Take any one solution from the internet which appeals to you the most, review the code - make sure you understand what is going on each step of the way - and document the solution as pseudo-code. Please make sure we acknowledge the source." Again, since the pseudo code has already been provided, i require only the python code w/ comments explaining the process.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
