See if you can figure out the answer.
There's a contest going on. There are 4 participants. Each participant had a hat put on them. There are two white hats and two black hats.
None of the participants are told what colour hat they have on. They're not allowed to look up at their hat to see the colour. They're all standing in a single line and they're facing the right. They're not allowed to turn around or look around or anything. They can only see what's in front of them. One of the participants is in a seperate room, alone. The other three are in the same room as each other.
This is how it looks:

There is one person who figured out what the colour of his hat was by using all the factors. He knows for sure and he's not just guessing. Which person what it?
This isn't a trick question. There are no loopholes and no mirrors or whatever.
Remember! They can only see what's in front of them.
And my teacher said that the key of the riddle is the fact that there are two black hats and two white hats.
Edit: I forgot to say that they can't communicate with each other in any way. And the pattern of the colours of their hats is purely coincidental.





























