Ad
  • Custom User Avatar

    C Translation (author inactive).

  • Custom User Avatar
  • Custom User Avatar

    It's not clear for certain cases when and which cars the algorithm should turn away.
    For instance, given,

    [ /* 1 */[0,100], /* 2 - 7 */[5,10], [10,20], [20,40], [40,60], [60,80], [80,100] ]
    
    // 1:     | - - - - - - - - - - - - - - - - - - - |
    // 2 - 7:   | | - | - - - | - - - | - - - | - - - |
    
    

    I think Dave's gonna say no to just the first guy seeing he can then turn away only 1 vehicle instead of 6 (since the first guy would otherwise be stuck in the front). The prompt doesn't make it clear enough, though, as to what to return in this case.

    If it's made clear that the goal is to achieve the minimal value, then the puzzle becomes much more interesting (albeit a lot harder), but also requires additional tests to ensure cases like the above are satisfied correctly.

    If getting the minimum isn't required, then it really should be made clear that, for certain cases (like the above), multiple return values are accepted, as long as they don't turn anyone away unnecessarily (although, this makes generating random tests probably a bit difficult).

  • Custom User Avatar

    The description should be more explicit about the fact other vehicles cannot leave until the first one in queue does.

  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

    Hi, I really like the challenge of this kata.

    One suggestion is that in the problem description to describe what happens if a car that is in the queue is being blocked by a car in front of it that is still waiting to leave.