Ad
  • Custom User Avatar
  • Custom User Avatar

    C Translation (author inactive).

  • 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.

  • Custom User Avatar

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

  • Custom 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.

  • Custom 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.

  • Custom User Avatar

    Ok, thanks. But how to fix it?

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

    The user can modify the input.

  • Custom 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.

  • Custom 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.

  • Custom 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?

  • Loading more items...