Can you solve the $20 riddle? ft SMBC Comics' Zach Weinersmith

It would take too long for the first person to be able to count out the numbers of different color hats in a line of 100 people, plus the prisoners would be at different heights skewing the numbers. They would have to be lined up shortest in the back, tallest up front, but the warden would know that and not allow it.

Therefore I think the best solution is to be able to guarantee around 50% if every other one would sacrifice themselves and tell the person in front of them what color their hat is. Even still, those who sacrifice themselves only have a 50% chance of choosing the wrong color. Pretty simple. If accents, studders, or tone changing is allowed, you could even have one for a if per chance it happened to be a repeating pattern of green, purple, green, purple, and another one for purple, green, purple, green. Then you could save about 99% of them.