Wrong testcase [Solved]


  • 0

    The problem statement says answer_id is not null when action column is "answer", while are null for "show" and "skip".But here in the below test case , one row has column as "answer" and answer_id as null. Please fix it.

    {"headers": {"survey_log": ["uid"
    "action"
    "question_id"
    "answer_id"
    "q_num"
    "timestamp"]},"rows": {"survey_log": [[5
    "show"
    285
    null
    1
    1]
    [5
    "answer"
    285
    123
    1
    2]
    [5
    "answer"
    369
    null
    2
    3]
    [5
    "skip"
    369
    null
    2
    4]]}}


  • 0
    K

    @vivek_23 Thanks for your kindly remind, the test cases had been corrected.


  • 0

    Thanks @kexiao1612
    The issue seems to be fixed. But, there seems to be 1 more. For the same testcase (considering 123 instead of null for 3rd row, the expected answer seems to be 369.

    However, in this scenario, both 285 and 369 have an answer ratio of 0.5. So, what needs to be done in case of a tie ? Or is it that somewhere I missed something ?


  • 0
    K

    @vivek_23 Thanks for your carefully notice, in fact, they are not all ratio 0.5, for 285, the ratio is 1/1, while for the ratio is 1/0, so the result is 285


  • 0

    @kexiao1612 Thanks for correcting. Everything looks fine now.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.