🧠The 100 Prisoners and A Red/Black Hat Puzzle
100 prisoners stand in a single-file line facing forward. Each wears a red or black hat. Each can see all hats in front of them, but not their own or those behind them. Starting from the back, each must guess their hat color. How can 99 of them be 100% guaranteed to survive?
💬 Computer science parity bits saving human lives! Isn't algorithmic thinking beautiful? (Solution in first comment 👇)
#brain #prisonerspuzzle #parity #computerscience #algorithms