Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
But we are? We just take the information that there must be exactly one Mr. Wrong into account when finding him. He is still Mr. Wrong, and he still lies. The only difference is that we determine that what he says are lies by confirming that what everyone else says is true, and therefore what he says must be lies.
You are incorrect. The description is accurate, there is always exactly one Mr Wrong. The only times at which you should return
null
is if you cannot determine who it is. The test cases are actually generated by creating a list of people, choosing one of them at random to be Mr Wrong, and then creating statements for each person, making sure that only Mr Wrong's statements are lies.It seems to me like perhaps you are misunderstanding what "Mr Wrong" is. "Mr Wrong" is a single person, who always tells lies. It is not merely anyone who says something that contradicts with another person. There can be, and always is, exactly one person who is Mr Wrong.
Fred is Mr. Wrong by process of elimination. Its either Fred is a liar, or there are multiple liars
Currently the description says:
And then later:
Do you find this unclear?
I think there may be some confusion here, but the task says there is ALWAYS one person lying.
If one of the persons is Mr. Wrong, then by elimination it cannot be Tom (that would entail Bob lying as well), cannot be Bob, nor Gary - by the same logic. Only Fred states something that isn't backed up by the others. So if someone IS lying, it must be Fred; and the tasks says someone IS lying in every example.
this where clause gets optimized and acts as a join, no performance cost here