There is a wrong test case.


  • 0
    C

    For the test case: {"headers":{"insurance":["PID","TIV_2015","TIV_2016","LAT","LON"]},"rows":{"insurance":[[1,224.17,952.73,32.4,20.2],[2,224.17,900.66,52.4,32.7],[3,824.61,645.13,72.4,45.2],[4,424.32,323.66,12.4,7.7],[5,424.32,282.9,12.4,7.7],[6,625.05,243.53,52.5,32.8],[7,424.32,968.94,72.5,45.3],[8,624.46,714.13,12.5,7.8],[9,425.49,463.85,32.5,20.3],[10,624.46,776.85,12.4,7.7],[11,624.46,692.71,72.5,45.3],[12,225.93,933,12.5,7.8],[13,824.61,786.86,32.6,20.3],[14,824.61,935.34,52.6,32.8]]}}

    My answer is 4220.72, but the test case gives 4934.85.

    The difference is the record pid=8, but its location information is not unique (The same as record pid=12).


  • 0
    A

    This is not a wrong test case.
    You first have to filter data for same TIV_2015 value
    and then on this filtered data set you have to apply the lat lon check


  • 0

    I am the author of this problem. Sorry for confusing you.

    Actually, there are two different ways to understand this problem:

    1. Meet criteria #1 and then #2 in order.
    2. Meet these two criteria at the same time.

    I am now working with the problem source to decide which is more suitable. I will let you know once it is decided, and then I will update the problem description accordingly.

    Thanks for your posts. Have a nice day.


  • 0

    @CodingKing You can try to submit your code again since the test cases have been updated. Let me know if any other questions.


  • 1

    @ankit081190 If your code was accepted, please rewrite your code and submit again since the problem description was updated, which means both of the two criteria should be met at the same time rather than in order.

    Sorry for the inconvenience. Good luck.


  • 0

    The problem description has been improved to make it more clear. Thanks for your feedbacks and enjoy coding...


  • 0
    C

    @Mr.Bin Thanks for your effort.


  • 0

    @CodingKing No problem and I am glad to help you.


Log in to reply
 

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