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.
Yo, what do i have to learn to understand why str = "codewars", im talking serious!
If someone just add 10 more words, this doesn't seem very scalable.
I dont know if a failed but the random test for me is giving false as a different array but i copy and paste the random test in my code and try to see if they are different and they're completely the same array, so if you can check, maybe could be that im doing something wrong
This comment is hidden because it contains spoiler information about the solution
oh, got it, thank you
Idk if im wrong, but in my machine its working, im using array.flat() but when i try to used it here it show me an error, is it allowed to use array.flat?
yes, it is normal, because its a cache
This comment is hidden because it contains spoiler information about the solution
with cache into the filter function he is just asking
if cache[n] === undefined cache[n] will be 0, the first time
if cache[n] exist that means that you should increment +1
so the condition that he is returning is
if in my cache there is a number less than or equal to the argument x , return that
This comment is hidden because it contains spoiler information about the solution
completely agree
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
this only iterates the array 3 times, and with that you can know if the number is even or odd and with the find it will only iterate until it finds it, when it finds it it will stop and so I will not have to iterate over the array in case it has 10000000000 elements and it is in a close position.
Loading more items...