A puzzle from Google about 100 prisoners in a line. Each prisoner wears a red or blue hat. An executioner will move from the back of the line and ask people to say what colour hat they are wearing. If they get it right they live. You need a plan to optimise the number of people who survive.
dyno price