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 comment is hidden because it contains spoiler information about the solution
your solution is great too!
No idea, did the solution without thinking and saw other's solutions to realise it was completely pointless!
Keep in mind that this kata is not tagged as a performance kata. It is not calling for code to be tuned/optimized. This solution runs more than fast enough to finish within the 12 seconds that codewars allows.
Had this been an actual performance kata, I would have tuned my approach until it finished the test cases in the allowed time.
I suggest creating a performance variant of this kata if you're interested in taking it there. The problem sizes for this kata is currently limited to 26 letters. You'd want to mark the new kata with a performance tag and test and include tests that would keep naive or unoptimized solutions from finishing within Codewars' 12 second limit.
This comment is hidden because it contains spoiler information about the solution
Hi,
I only managed to solve this Kata with using eval(), but I learned a lot from others' solutions.
You can read why it is not a good thing to use eval() here:
Here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval
"Never use eval()!
eval() is a dangerous function, which executes the code it's passed with the privileges of the caller. If you run eval() with a string that could be affected by a malicious party, you may end up running malicious code on the user's machine with the permissions of your webpage / extension. More importantly, a third-party code can see the scope in which eval() was invoked, which can lead to possible attacks in ways to which the similar Function is not susceptible. "
Thanks for this very useful site! I wondered how to compare efficiency of my code with other solutions, and now it's easy
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution