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.
so use the reduce is optimial because O(n) ?
nice try
This is O(n logn). The optimal is O(n).
I basically created an extra variable for no reason. -______-
Great Job.
This is what I consider clever, not using the built in function.
same
Didn't think of that. Good Point! Also like your solution using the spread operator.
Mutating the parameter ... ouch!
nicely done!
Yes, I think there is only one parameter. I got the same error.
You are probably not considering the order of the characters. If you can't put the strings on top of each other, like in the description, they are not considered a merge.
Good luck! :-)
When I sumited, I passed all random case except 2 case.
one case. isMerge('codewars', 'code', 'wasr')
two case. isMerge('codewars', 'cwdr', 'oeas')
I dont' know why not passed!
So I guessed... one case is becasue 'r'.
two case is 'w'....? 'cdwr' return true, but 'cwdr' return false?
I understaned to make checker function.
My code check second, third parameter char as same as first parameter. (Character count)
Hi, I copy your code and run it, got
Process was terminated. It took longer than 8000ms to complete
. It's not aboutShould not modify the original array
. It only means that your code is too slow. You need to optimize your code and make it run fast ;-)I've read your code, it seems not modify the original array, perhaps the reason may be your code got a incorrect result at this test part(I am not sure, because I can not test your code now, I using a phone, only can browse web page but can not running code. I will test it when I using a computer ;-)
This comment is hidden because it contains spoiler information about the solution
Loading more items...