Ad
  • Custom User Avatar

    The problem is nice, because of it's story with a broken ferry. I like stories.

    Noticed that there is certain ambiguity in the formulation.

    1. it is not so obvious what would trigger the ferry to travel to the opposite bank.

    A car may arrive at either river bank to be transported by the ferry to the opposite bank.

    So the cars are not initially waiting in the queue, but might come

    The cars are loaded in the order of their arrival;

    So if some car comes on the oposite bank the ferry must pick it first

    In the meantime, lines of cars formed on both banks that await to cross the river.

    So the cars are already formed some lanes

    in first two sentences sequence of arrivals:

      {"left",10},{"left" 20},{"right",50},{"left",9}
    

    should trigger 3 moves

      {"left",10},{"left" 20}
      {"right",50}
      {"left",9}
    

    while last prioritise this solution:

      {"left",10},{"left" 20},{"left",9}
      {"right",50}
    

    The last solution was chousen to be correct by the author. It would be good to specifically highlite that given
    std::vector<std::pair<int,std::string>> loads is the queue which is already waiting in the loading areas, ordered by the retrospective historical time of arraival.

    1. Another point is: "what to do if any particular car is begger than the ferry?"

    The test cases are not covering such point, but probably it is worth mentioning in the description.

    1. And also names of the banks "left" and "right" is not it better to shorten those to char 'l' and 'r' or even make bool?
  • Custom User Avatar

    python new test framework is required. updated in this fork

  • Custom User Avatar

    How does CODEWARS need 5 stacks? The way I see it, any shipment, no matter how complex only needs 3 stacks at most, 2 stacks to toggle and 1 to add the containers in correct order. The description fails to describe the mechanics.

  • Custom User Avatar

    Description should be language-agnostic

  • Custom User Avatar
  • Custom User Avatar

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

  • Custom User Avatar

    My sollution can't pass random test. And in the all cases my cost < solution cost. However, all the basic tests and more than half of the random tests are passed correctly. Can I somehow see the conditions of random tests? Or how i can debug my solution?

  • Custom User Avatar

    The equation in the kata is reverted to an image again (and worse, it's also broken; hotlinking only previews part of the equation).

  • Custom User Avatar

    What is the point of supplying more passenger entry and exit numbers than exist stops on the line? Even if you were somehow trying to find only the maximum number of passengers during a certain subset of stops on the line, the description phrases the point of this exercise as being to determine the "tram's minimum capacity". If it later goes on to take on more passengers at any one time, then the tram would have to have a higher capacity. (Or maybe after a certain number of stops, a different, possibly larger tram is swapped in, I guess? Could be possible. But nothing like this is mentioned and even with that, the story problem starts getting messy...do they force the passengers still onboard at that point to switch trams?)

  • Custom User Avatar

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

  • Custom User Avatar

    The description is lacking clarity, and more importantly, an explicit specification of the output/task.

    I'd sugggest the following rewrites/additions:

    Given a binary number, we are about to do some operations on the number. Two types of operations can be here:

    to

    You are given a binary number as a string, and a list of instructions in the following form:

    Then:

    ['Q', i] : Answer whether the i'th bit is 0 or 1.

    to

    ['Q', i] : Read the ith bit and store it as a string

    Finally:

    The function should return as a list of strings all the bits read during the Q operations.

    Oh, and maybe specify that the MSB is the leftmost bit, since first can be ambiguous, said ambiguitiy is precisely why this clarification is needed in the first place.

  • Custom User Avatar

    Although we can figure out the input and output from the examples, it'll be much better if you also describe it verbosely. This gets worse when there is an inconsistency between the fixed test and the random test.

    In the fixed test case, the input are always an array with 2 items, as if the first item represents the X player and the second item represents the Y player. But in the random test, the array are bigger than 2 items. This won't be a problem if you have mentioned it beforehand.

  • Custom User Avatar

    For a performance kata the input size should be specified. What is the length of the input?

  • Custom User Avatar
    • Python new test framework should be used (Refer this & this for more detail)

    • Ruby 3.0 should be enabled (Refer this & this for more detail)

  • Custom User Avatar

    Is there an issue with the performance of the reference solution?
    It keeps timing out, even the 3 sample tests require at least 3-4 seconds.
    I'm pretty sure my solution is optimized, but I'm not an expert in C++.

  • Loading more items...