Jim and the Orders

  • + 3 comments

    The output of the test case is wrong. There is a misordering of entries 703 and 500 in the solution. Wasted quite a bit of time trying to figure it out :(

    • + 0 comments

      i am getting the same sequence . How to solve that ?

    • + 0 comments

      You are correct. The order in Test case-7 is wrong.

      Cust no: 703, Serve time: 905283, Order no: 133994 Cust no: 500, Serve time: 905283, Order no: 211415

      So the correct order has to be ...703,500,... Whereas the test case is expecting ...500,703,...

    • + 2 comments

      The test case is not wrong. You misread the problem description. It states "If two orders are delivered at the same time, assume they are delivered in ascending customer number order." (Not ascending order number).

      500 < 703 so the correct ordering should be 500 then 703, as given in the test case, not 703 500.

      You were probably checking the order number (211415 and 133994) instead of the customer number (500 and 703), which is not what it asks for.

      It took me longer than I'd like to admit to figure this one out. I was stuck on the exact same problem.

      • + 0 comments

        thanks alot

      • + 1 comment

        It seems like it's rather author's description writing problem than developers' reading problem. In the beginning of the description there is a statement:

        If two orders are delivered at the same time, assume they are delivered in ascending customer number order.

        while in the very end there is a note:

        While not demonstrated in these sample cases, recall that any orders fulfilled at the same time must be listed by ascending order number.

        Those statements look quite contradictory to me, so it's no wonder that some people are confused.

        • + 0 comments

          One test case got stuck because of this problem. I checked the order number but still it passed all the test cases excpet one. This is so strange.