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.
What would be the problem with 2 million ingredients? That this solution has no early return in case of 0? If you return any positive value, you have to look at all ingredients either way.
what if the recipe has 2 million ingredients? ok ok, I'm overthink, I think that this solution fits very will for the whole context of the problem
This comment is hidden because it contains spoiler information about the solution
Congrats! The shortest solution.
super logic
Ashamed that I didn't realize it was this simple...
all occurrences
will this solution delete all the repetitions of the letters in text (e.g. "a" found 2,3.. n times) or delete only one occurence?
thank you
I can see some of your solution, I do not knwo if it is the most recent one. And yes, I can see a bug in it, which would cause the crash.
As a first step to diagnose the issue, I would recommend recreating the failing test case in your local IDE and debugging trough it. Use your IntelliJ, Eclipse, NetBeans, or whatever is what you use for coding on your computer, and run your solution with the input which Codewars says you can;t handle. Debug through your code, find the place where it crashes.
You can also visit CW Discord and
#help-solve
or#java
channel.Now fixed.
Approved.
Oh, never mind, I misread! Have changed the test logs in the fork to report test input, too.
Seems like that would duplicate the existing output from the test harness, no? The logs are already in the following form:
Just return the numbers: expected <solution return value> to equal <expected return value>
.Looks good to me. Just a remark: it's better practice to provide the input to user for failed tests (something like
failed test with value = ..., expected ... but got ...
).Loading more items...