Lineup

A group of children are standing outside a room. Each wears a hat that’s either red or blue, and each child can see the other children’s hats but not her own. At a signal they enter the room one by one and arrange themselves in a line partitioned by hat color. How do they manage this without communicating?

Click for Answer