nadeemshafi9 Posted June 14, 2007 Share Posted June 14, 2007 Hello Guys A question was put forward to me by an interviewer and i was quit baffled. If you have a container that can hold 4 litre and one that can hold 9 litre, how do you get 6 litre's exact. You are not allowed to hold any units outside the two containers. I have solved parts of the problem. Thanks for any help Link to comment https://forums.phpfreaks.com/topic/55640-problem-question-1-help-plz/ Share on other sites More sharing options...
Orio Posted June 14, 2007 Share Posted June 14, 2007 Fill the 9, pour to the 4 until top. Now you have 5 in the 9 and 4 in the 4. Empty the 4, and pour from the 9 to the 4 until top. Now you have 1 in the 9 and 4 in the 4. Empty the four and pour the 1 liter that is in the 9 to the 4. Now you have 0 in 9 and 1 in 4. Now fill the 9 and pour into the 4 until it fills and walla- you have 6 in the 9. Orio. Link to comment https://forums.phpfreaks.com/topic/55640-problem-question-1-help-plz/#findComment-274932 Share on other sites More sharing options...
nadeemshafi9 Posted June 14, 2007 Author Share Posted June 14, 2007 O M G very well done !!!, i got up to the 1 part Link to comment https://forums.phpfreaks.com/topic/55640-problem-question-1-help-plz/#findComment-274938 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.