spent last 15 minutes on this, and still no clue.

Alternative answer- since the prisoners can see each others hat, they are sitting in a circle, And one prisoner was able to see the reflection of his hat in the eye of other. (but i guess they are too far apart to do this ).


White hat , black hat , Is This SEO related question <!-- too tired to think -->