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.
The benchmark result
Bitwise operation
3.9M ops/s ± 0.95%
With while loop manual factorization (My solution)
1.7M ops/s ± 1.09%
57.42 % slower
The top rated solution, using javascript crap functions :D
136K ops/s ± 1.25%
96.55 % slower
Thats interesting!
This comment is hidden because it contains spoiler information about the solution
It think it should
This comment is hidden because it contains spoiler information about the solution
Very slow
What happens if n is not a number? It should have a check
This comment is hidden because it contains spoiler information about the solution
no it should not. read the description.
I think you shouldnt change MORSE_CODE. You should take it as an external variable.
A good practice would be to declare your scoped MORSE_CODE_LOCAL = Object.assing({}, MORSE_CODE)
And then make the override.
This is a better approach. It's important to clean the input
Not recommended at all
This solution doesn't consider dirty inputs.
A test should include "noise". Add chars that are not dots or dashes or whitespaces