We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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 :(
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.
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.
Jim and the Orders
You are viewing a single comment's thread. Return to all 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 :(
i am getting the same sequence . How to solve that ?
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,...
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.
thanks alot
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:
while in the very end there is a note:
Those statements look quite contradictory to me, so it's no wonder that some people are confused.
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.