npm install
npm run play <elevator start> <comma separated floors to visit>
Provided example would be as such: npm run play 12 2,9,1,32
Tests can be run using the test script npm run test
- There are only numbered floors (no G, M, L, etc)
- All valid floors are whole numbers
- All whole numbers are valid floors (no skipping 13)
- All consecutive floors are the same distance apart
- Time between consecutive floors is consistent, regardless of how many or few floors are traveled (elevator does not speed up during longer trips)
- Single floor travel time: 10 (Provided)
- It takes no time to stay on the same floor (the same floor multiple times in a row will not add to the travel time)
- Time spent stopped on a floor is not included in total travel time, as this is not time while traveling
- Floors are traveled between in order, without any optimizations in between