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

    I still think this is worded confusingly, since there are statements which, when taken alone, are not correct.

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

    I think this statement is misleading for a few reasons:

    • first, we are not technically looking for Mr. WRONG - we are looking for the person who has no alibi. Mr Wrong is not always Mr. Wrong, he just has noone who can support his claims.
    • "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."

    This is a 2 Kyu, so I guess it can be hard. However, i think the difficulty comes from non-elegant components of the description. I am not sure how you would fix this. Either the explanation needs a big overhaul, or you should remove test cases that conflict with the description.

  • 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?

  • Custom User Avatar

    Thanks. That IS a big misunderstanding on my part - this really changes up my logic.

    Upon review - I do not see the phrase "someone is ALWAYS lying" in the description. I think this should be added. "There is always at least 1 liar - in thhe case of MULTIPLE liars or if it is inconclusive, return None."

    Neat problem! I think the description is really key here.

  • 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.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I failed a test requiring no "PARTITION" clauses because I has a commented-out line with "PARTITION" in it. Maybe the tests should ignore commented-out lines? I realize that it might be bad form to leave tons of comments, so I don't feel too strongly about this.

  • Custom User Avatar

    Thanks. I was unfamiliar with it.

  • Default User Avatar

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

  • Custom User Avatar

    Is this slower than a join? The "WITH" clause is OK, but why not do a join? Seems like you are filtering down from a much larger data set.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    remember, you are creating a view, not just a select statement. That helped me along on this.

  • Loading more items...