Qm

Two boys, a tiny boat and twenty soldiers

Twenty soldiers arrive at a river and find two boys playing in a small rowing boat. The boat can carry either two boys, or one soldier, but not a soldier and a boy together. Everyone can row.

The soldiers must all get across, and afterwards the two boys must be back together with their boat on the side where they started, so they can carry on playing.

How many one-way crossings does the whole operation take?

Show a hint

Work out how many crossings it takes to get one soldier across and return both boys and the boat to the starting bank. Then multiply.

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

Sign in to join the discussion · reading is open to everyone

💡 Discussion rules

  1. No full solutions here. Hints and approaches only.
  2. Complexity, edge cases and intuition are the point.
  3. Interview experiences are welcome. Respect your NDAs.

Loading discussion…

Learn the concepts

The theory behind this question.

Related questions

Ferry eight across when the boat holds fourTen people, a two-seat boat, how many crossings?100 prisoners and the light bulbAnts on a triangleBinary strings with no two 1s in a row
All questions →