A hundred walkers who turn around when they collide
A hundred robots stand on a long straight line, one metre apart, numbered 1 to 100 from left to right. Robots 1 to 50 start walking to the right and robots 51 to 100 start walking to the left, all at the same speed of one metre per second. Whenever two robots meet, both instantly reverse direction and keep walking at the same speed. The line is long enough that nobody ever falls off.
How many collisions occur in total?
Show a hint
When two identical robots bounce off each other, the picture looks exactly as if they had walked straight through each other. Use that.
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.