Ad
  • Custom User Avatar

    In Python, if the user's solution modifies traffic, test cases break. In the tester code, pass a COPY of the list to the solution with traffic[:] to fix this.
    In the meantime, I managed to submit my solution by copying the traffic list like this: t = traffic[:] and using my copy to solve the problem.

  • Default User Avatar

    It's a side effect of the other issue ("The user can modify the input").

  • Default User Avatar

    I know it sounds kinda stupid, but the sensei should mention that multiple cars can pass in one go, and that the order of the cars is important
    Otherwise, this kata is quite a fun one to solve

  • Custom User Avatar

    Or, assuming you're not modifying the input (which you do here), compute the expected result before calling the user's solution.

  • Default User Avatar

    Prior to running the user function: make an additional, distinct copy of the input, send one to the user (which they can mutate if they wish), and send the other one (uneffected) to your reference solution.

  • Custom User Avatar

    All random tests expect an answer of one, even when the correct result is clearly way above one.

  • Default User Avatar

    Ok, thanks. But how to fix it?

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    The user can modify the input.

  • Default User Avatar

    Ok, thanks, now I tried, and i failed on this example/test: [15, 13, 7, 26, 10], 30). Output should be 3, right? (15+13),(10+7),(26) Or, i guess order is important. Ok, got it.

  • Default User Avatar

    The tests have something like this ([1, 1, 1, 1, 1, 1, 1], 8) In this case, all cars will pass at once. Cars stand in line one after another.

  • Default User Avatar

    Could I ask: how many vehicles can pass in the same time? How many tracks are on the road? Are two vehicles in one pass - max?

  • Default User Avatar

    Thank you, I will try to do it as soon as possible.

  • Custom User Avatar

    not an issue a suggestion.

  • Loading more items...