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.
'Looks like you've solved it'
This comment is hidden because it contains spoiler information about the solution
...
What's a linked list? (probably something in C++, not in JS )
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
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
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.
The return value for JS was not specified in the description. Apart from that, if one language requires to return
None
/nil
, most often its equivalent is required in other languages as well.So what is the issue then?
Not an issue - just read the description again:
Oh, and you can always print (console.log) the input...
Well, that means you need a better algorithm ;-)
Yes, and a certain number in your program is too small ;-)
I don't think it works in JS console at all either. It always returns
Pa! Aa!
,Pa!
or empty string.Loading more items...