Three missionaries and three cannibals are on one side of the river, wanting to get across.
Unfortunately, the only boat available can hold a maximum of two people. The missionaries, wanting to stay safe, can never be on a side with more cannibals than missionaries (even for a moment!). The boat cannot travel under its own power, so there must be at least one person on board for it to cross.
How can the missionaries get safely across?
assume 1,2,3 are missionaries and a,b,c are canibals
step.1) a,b --->
2) <--- a
3) a,c --->
4) <--- a
5) 1,2 --->
6) <--- 1,b
7)1,3 ---->
8) <---- c
9) a,b ---->
10) <--- a
11)a,c ---->
hope this is the solution, if there is any mistake inthe solution plzz post it