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.
There appears to be a bug in the Python version's tests.
This code does create a method on the prototype. It does not create a separate function for every Ship instance. Test it for yourself if you don't believe me :)
The instructions specify
You will get a String str with an even length
, but the tests seem to be inputting strings of both parities for me using Python 3.8Ok. To me, it seemed implied by the wording of the phrase "the total waiting time is", since the total waiting time is exactly what the solver must determine. I think there might be less potential for confusion if it read something like "the total waiting time if brewed in this order (which may not be optimal)".
(Sorry, I'm trying to mark this question as resolved, but it's saying I'm not authorized to.) (edit: because Stefan30 already marked it resolved while I was typing this lol)
I'm confused. You said we can brew the cups in any order we want, so why can't we brew the 3-cup first and the 5-cup second for a total waiting time of 3+2+3+5?
Sorry if this is a stupid question: Is there any way to determine from the instructions what the expected output is for any given input, or is the intended solution for people to copy-paste the code from the linked Wikipedia page?
I have generated this placement for the last sample test, and I agree with the sample test code that its score is 72, which is higher than the hardcoded optimum score of 68. What's going on? Is it an invalid placement (and which rule does it break)?, or are both the sample test code and I miscalculating the score?, or is the hardcoded optimum score wrong (and should the optimum scores be hardcoded)?
The sample tests call
countNeighbors
, which is not defined. While the solver must work towards that functionality in the course of solving the kata anyway, if you intend for the solver to define and implementcountNeighbors
themself, it would be better to say so explicitly in the instructions rather than make them look through a bunch of sample test code to figure out its signature and expected output.This kata has me reversed in the head. :/
😅Ahaha, sorry. Took me 12 myself
There appears to be no enforcement of the rule.
I assume ImmePak meant that the function iterates through the array twice: once to find the minimum, and again to find the maximum. Thinking about performance, it's theoretically unnecessary and somewhat inefficient to do that. (I don't know whether V8 optimizes it away; I assume not).
However, I find this solution simple and easy to read. If this function would be called infrequently and on small arrays, it would waste only an insignificant amount of time.
Would it be reasonable to ask for more descriptive failure messages? I feel confused and frustrated after passing all 149 fixed tests but then seeing the second random test fail with the message "The element has been just added to the set."
Extended ASCII systems do, but ASCII at its most classical is actually seven-bit.
It's not, as my solution demonstrates (:
Loading more items...