Interview Puzzles :: Discussion
-
Missionaries and Cannibals
Three missionaries and three cannibals must cross a river. There is a single boat which can carry a maximum of two people and there must be at least one person on board (the boat cannot cross by itself).
On either bank, if there are missionaries present, the count of missionaries must be equal or greater than the count of cannibals, else the cannibals would eat them.
Explanation :
No Best Answer on this question yet!Asked In : Wipro
missionary be m and cannibal be c
Firstly 1m and 1c will cross. Then 1m will return back. Then again 1m and 1c will cross and again 1m will return.
So now 3m,1c on one side and 2c one one side. Now again 1m and 1c will go and 1m will return. So now 3m one side and 3c another side.
Now 2m will go and 1c will return. So 1m and 1 c will be on one side and 2m and 2c will be on another side.
Finally 1m and 1c will go and the task is done.
All the constraints are followed.