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.
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.
I'm going to study the solutions that consistently pass this kata and rework the description of this kata accordingly. It is clear that ref sol and description don't align perfectly.
I re-published the kata and re-raised pending issues.
The necessity of resolving and re-raising the issues is a bit of a hassle, but hopefully it will not be necessary too often, since now old kata should not be auto-unpublished.
Loading more items...