Ad
  • Custom User Avatar
  • Custom User Avatar

    we are not technically looking for Mr. WRONG

    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.

    "only one people is mr wrong" is just false. This should read "at LEAST one person is Mr. Wrong, and you should return "null" if there is more than one Mr. Wrong OR if you cannot conclude that someone is Mr. Wrong."

    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.

  • Custom User Avatar

    Fred is Mr. Wrong by process of elimination. Its either Fred is a liar, or there are multiple liars

    Please note that everyone has at least one sentence and only one people is Mr.Wrong

  • Custom User Avatar

    Currently the description says:

    Mr.Right always tell the truth, Mr.Wrong always tell the lies.

    Some people are queuing to buy movie tickets, and one of them is Mr.Wrong.

    And then later:

    Please note that everyone has at least one sentence and only one people is Mr.Wrong ;-)

    Do you find this unclear?

  • Default User Avatar

    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.

  • Default User Avatar

    this where clause gets optimized and acts as a join, no performance cost here