Three friends named Mr. Black, Mr. Yellow and Mr. Green enter a pub on a weekend night. They are wearing either a Black, Yellow or Green shirt.
Mr. Yellow says to them, 'Did you notice that we all are wearing different color shirts than our names?'
To this, the man who was wearing the Green shirt said. 'Wow, thats right.'
Can you identify who is wearing which color shirt ?
The answer is right in front of you. Since all are wearing different color shirts from their names, we know that Mr. Yellow is either wearing a Black or a Green shirt. But through the two statements, we already know that Green shirt is worn by somebody other than Mr. Yellow. Through this we can deduce that Mr. Yellow is wearing a Black shirt.
Now Mr. Green is definitely not wearing a Green shirt and since Black shirt is already worn by Mr. Yellow, he must be wearing a Yellow shirt.
Now we have one person left and one color left. Thus, Mr. Black must be wearing a Green shirt.