Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Without a specific python function, this was very confusing.
Your code fails for
(1 1 0)
. The distance ofcall
toleft
&&right
respectively is the same, so the answer should beright
.according to the instructions "the elevator should take the second call if it is closest to both calls AND if both floors are in the same direction for the elevator AND both calls are in the same direction even if it needs to change it's direction once to pick them both up." How is floor 5 closer to -7 than a lift at -4 moving downwards?
Am I missing something here?
[5,-5,{"floor":-4,"direction":"down"},{"floor":-7,"direction":"down"}]: expected 'right right' to equal 'right left'
Right is closer to both, both are in the same direction and it doesn't have to change direction
changed to
Description is indecisive about how many floors exist: if the actual range of floors can be unbounded in both positive and negative ranges, the description shouldn't start with
and 5 floors (0, 1, 2, 3, 4)
and then invalidate this statement at the end of the description, that's just being nasty and unnecessarily misleading.Thanks for your efforts.
Important notes added to the description
fixed
Updated to node 18 and error messages improved.
fixed
fixed
I've updated the ref sol and made some edge cases more clear in the description. Could you retry?
The ref sol does not take into account one caller being on the same floor as both being on the same side (up / down) of an elevator. I'll rework the ref sol. This will probably invalidate most if not all solutions.
Loading more items...