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.
Thanks FA. I'm going to study up on efficiency in code.
You should minimize your code time complexity. Or if that is not possible (any more), you should optimize your algorithm to perform less costly operations.
Hint: your solution should be fully linear, sorting the input array will already make you time-out.
Also, I've updated the tests, so you'll have to reset your trainer, reload the page, and... reset the trainer again. Save your code before doing that (Ctrl+C) as everything will be cleared and restored to defaults (alternatively, after doing these operations you can click onto the trainer and press Ctrl+Z, as clearing the editor window through
reset
is a reversible operation).Hey blind4, I'm just a 5 kyu, so excuse my ignorance..
Does more efficient mean faster? My code claims to finish all the tests but 1 performance test in 16 milliseconds.
Adjusted the tests in JavaScript - checking correct solutions will take approximately 25% less time than before, and (hopefully) only linear solutions should pass.
This issue was concerning JS version only, so I'm closing the issue.
Removed that terrible error message.
Added.
Modified the description to be more clear, and rewrote the examples in the description to show this clearly.
thanks.
didn't know there was an efficiency requirement.
this is the first kata i've seen that on.
your code: you have to think about a more efficient algorithm.
my code is timing out in codewars environment but running fine in chrome console.
is my code the problem or the tests? (javascript)
I have to agree with this.
new rule: if your example explains your kata, your description is not good enough.
freecodecamp has exercises similar to these katas and they're simple so that you can pickup the syntax at your own pace.
also, if simple kata is what you look for. give yourself simple exercises like the one you created in your question. write down five simple problems that you THINK you can do, and figure out how to do it in your browser's console.
dude, thank you.