Ad
  • Custom User Avatar

    This should not be tagged as an issue, but merely a suggestion.

  • Custom User Avatar

    ^ That. i actually only saw the get-requirement aufter succesfully submitting my solution...

  • Custom User Avatar

    You are absolutely right! I think, I written this from instinct :D

  • Custom User Avatar

    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.

  • Custom User Avatar

    Oh, thanks, I didn't take immutability into consideration, and created cyclic references :D

  • Custom User Avatar

    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.

  • Custom User Avatar

    that's actually a nice name. Thank you :D

  • Custom User Avatar

    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, like

    class Cons {
      constructor(value, next) {...}
      static fromArray(array) {...}
      filter(predicate) {...}
      map(predicate) {...}
    }
    

    but I can't do this, since Cons is already defined.

  • Custom User Avatar

    how about "fruitBasket" or just "basket"? Even "groceries" or "fruits"...

  • Custom User Avatar

    You take this to the next level m8 :)

  • Custom User Avatar

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

  • Custom User Avatar

    I had the same thought while writing this kata, but I just don't know. I ran out of names :)

  • Custom User Avatar

    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.

  • Custom User Avatar

    In my opinion, the parameter name shouldn't be rotten, since there can be healthy fruits too in that array. Just nitpicking here :)

  • Custom User Avatar

    I think I got a working implementation. When I run it, the first 3 tests run ok, then I get this message:

    After pushing an 'a'
    Process was terminated. It took longer than 6000ms to complete
    

    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.