Three guards, three prisoners, one two-seat boat
Three guards and three prisoners must cross a river. The boat holds at most two people, and someone must row it each way; both guards and prisoners can row. If, on either bank (or in the boat), the prisoners ever outnumber the guards present, the prisoners overpower them. A bank with prisoners and no guards is fine.
What is the fewest number of one-way crossings needed to get everyone across safely? Give the sequence.
(This is the old missionaries-and-cannibals puzzle in a different costume.)
Show a hint
Count crossings, not round trips, and remember the boat must come back with at least one person in it. Start by sending two prisoners over.
Your answer
Solving needs a free account
Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.
Discussion
💡 Discussion rules
- No full solutions here. Hints and approaches only.
- Complexity, edge cases and intuition are the point.
- Interview experiences are welcome. Respect your NDAs.
Loading discussion…
Learn the concepts
The theory behind this question.