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.
This should not be tagged as an issue, but merely a suggestion.
^ That. i actually only saw the get-requirement aufter succesfully submitting my solution...
You are absolutely right! I think, I written this from instinct :D
Using a stack is the right solution if you have to keep track of different elements which must be nested, like different kinds of parenthesis () [] {}.
If you come across the line
stack.push(null)
without other usages, it is a hint that you can use just a counter variable instead.Oh, thanks, I didn't take immutability into consideration, and created cyclic references :D
That is not an error message from the kata but from the code wars system.
Every kata must complete in less than 6 seconds of processing time.
Check your code for infinite loops or find a way to optimize your code to run faster.
that's actually a nice name. Thank you :D
It would be really great, if
Cons
could be defined elsewhere (NOT in the test code). I tried to give it a somewhat cleaner skeleton, likebut I can't do this, since
Cons
is already defined.how about "fruitBasket" or just "basket"? Even "groceries" or "fruits"...
You take this to the next level m8 :)
This comment is hidden because it contains spoiler information about the solution
I had the same thought while writing this kata, but I just don't know. I ran out of names :)
The error messages are not really helpful. I didn't read how factorial is calculated, added the if (num <= 1) { return num; } as terminating condition, and got "1" as error message.
In my opinion, the parameter name shouldn't be
rotten
, since there can be healthy fruits too in that array. Just nitpicking here :)I think I got a working implementation. When I run it, the first 3 tests run ok, then I get this message:
Could the message be more specific? Or could we see, what is tested? At this point I have no idea what the test did, and where should I start fixing the implementation.