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.
Alienware: "You're hired"
oh man ,you use chars less than me!!!!
nice
I can't thank you enough for your solution and detailed explanation!
According to the results from jsbench.me, this is one of the slowest solutions...
You can use jsbench.me
Oh my > Lovely!
Don't know much about that, but a pretty basic way to measure times is getting the time before execution then subtract that time to the time after execution, that could give you time execution, "could" because it's not consistent for several reasons, like, it depends on the specs of your device, programs you're running, etcetera, so this is just like an archaic way. Actual pros analyze the time and space complexity of the algorithm as a whole, considering the size of the inputs, cost of each function call, loops, and more stuff, which I don't have any knowledge on those topics.
Ok I believe this is the XOR bitwise operator, used here to filter if either group has the character in question. This has been chosen over the standard '||' as it enforces one or the other but not both.
How do you make measurements like that? I am a noob but try to think about the efficiency of my code and wonder about ways I could check.
Does anyone know the meaning of ^ in this solution?
I carried out measurements, on lines more than 10,000 characters long, this solution ceases to be effective. It seems that on long strings, converting to sets is more expensive than actually checking for matches in the original strings.
?
I finally get it. Thankyou for taking the time to explain this, I appreciate it.
The confusion seems to come from misreading the body of the arrow function:
In the code above,
map.set('foo', v)
is not called beforenew Map()
because it's inside the anonymous function passed tofoo
.Maybe rewriting like the following will help you understand:
Loading more items...