Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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.
So the cars are not initially waiting in the queue, but might come
So if some car comes on the oposite bank the ferry must pick it first
So the cars are already formed some lanes
in first two sentences sequence of arrivals:
should trigger 3 moves
while last prioritise this solution:
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.The test cases are not covering such point, but probably it is worth mentioning in the description.
"left"
and"right"
is not it better to shorten those tochar
'l'
and'r'
or even makebool
?python new test framework is required. updated in this fork
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.Description should be language-agnostic
Python translation
This comment is hidden because it contains spoiler information about the solution
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?
The equation in the kata is reverted to an image again (and worse, it's also broken; hotlinking only previews part of the equation).
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?)
This comment is hidden because it contains spoiler information about the solution
The description is lacking clarity, and more importantly, an explicit specification of the output/task.
I'd sugggest the following rewrites/additions:
to
Then:
to
Finally:
Oh, and maybe specify that the MSB is the
leftmost bit
, sincefirst
can be ambiguous, said ambiguitiy is precisely why this clarification is needed in the first place.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.
For a performance kata the input size should be specified. What is the length of the input?
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)
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...