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.
Approved
python new test framework is required. updated in this fork
'Looks like you've solved it'
it is showing list out of index error
This comment is hidden because it contains spoiler information about the solution
...
What's a linked list? (probably something in C++, not in JS )
Well, that's a CW bug, and it is not new.
Thanks for the reply! I've tried using
unshift
, it works just the same but it times out. I am not really too familiar with performances in terms of array methods, or why should one be more efficient than the other. Also, there have been several katas that I couldn't complete because of this problem.I would really like to find out once for all what would make a simple code like this so much more efficient!
CoffeeScript and Crystal translations kumited.
splice
andpush
are slowing it down. It looks like you have O(n^3) code almost.First, can you figure out how to do it without
splice
?Well, Your Most Recent Trained Language (JavaScript) is not in my ToolBox, But There are Some Fixed OutLines Even if the Language Changes :
The Vector's/Array Size that Passed to the function contains 60.000 elements, the random Ones Contains 200 Assertions with 60.000 elements for each, Which Means, O(N log N) Solutions Will Only Pass.
in (JS),
Splice
takes up to O(n) in its Worst Case, Hope This HelpSo, Mike, Try to reconsider the Posted Code, Tune it to the Bone, Tuned to Hear Your feedback, wish you all the Best Bro .. Regards .. Zizou
This comment is hidden because it contains spoiler information about the solution
As a pro, I wouldn't consider this best practice because the comments are just noise, distracting from the really basic code. I'd facepalm if I saw this in production.
seems like a duplicate given that it only requires basic iteration to filter and map values using simple arithmetic operators.
Loading more items...