Ad
  • Custom User Avatar
    Don't take a second call if it requires changing direction
    Log
    4 1 { floor: 1, direction: 'down' } { floor: 2, direction: 'down' }
    expected 'right right' to equal 'right left'
    

    Doesn't this fall under the edge case 'e'? Both directions are the same, the same elevator is closer to both calls, and the elevator only has to change direction once?

  • Custom User Avatar

    Fixed tests and random tests have different input date string formats:

    Fixed test: 'Thu Feb 07 2019 12:00:00'
    Random test: 'Fri Oct 27 2023 11:34:44 GMT+0000 (UTC)'
    

    More crucially, why pass in date strings when passing in a Date object is infinitely more appropriate for the task? This is just bad kata design.

  • Custom User Avatar

    Hi, I'm about to ask a dumb question (still learning.) Nothing shows up (correct or incorrect) when I press return. For reference, I'm new to js and I use VSC to do my work/study instead of regular terminal. Could someone explain please?

  • Custom User Avatar
  • Custom User Avatar

    Description should be language-agnostic

  • Custom User Avatar

    Iterate over an array and compare values

    The idea is not novel at all. You could at least enforce O(1) solutions...

  • Custom User Avatar

    How can the stops array be empty ?!?

    I'm tempted to think that's physically impossible - there would be no starting position for the buses.

  • Custom User Avatar

    No random tests.

  • Custom User Avatar

    Description and Initial code are inconsistent with Example tests: number of arguments is different. I can only hope Submit tests are consistent with Example ones.

  • Custom User Avatar

    Direction of buses is unspecified. Apparently, the second bus reverses through the array?

    Do not rely on examples for these things. It makes us mindreaders, and we are not.

  • Custom User Avatar

    Sample tests are useless.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
    1. If both strings are equal in length ..

    Which strings are referred to here? ( Up to this point, the descripion only mentions arrays and integers. well, and a function and an object. but I'm guessing those are not what's asked anyway. )