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.
Wow, that's genius. I tried to use regex but had no idea how. Thanks man!
That's because you're returning the wrong thing.
Why you didn't use template literal?
No problem!
The top
Test.assertEquals(...)
line is for the previous set of array1 and array2. The arrays below are for the next set.Thank you for raising this.
If you're talking about the example case with that input, you might have misread it.
It is:
In this case, it would be false, since there are two pairs of the same element in array2, but only one such pair in array1.
Hi,
I have the same problem. Did you find the way to make this work? It´s driving me crazy!!! :D
Thanks
The last test 'measures' the time your code takes. You can collapse the first set of tests to better see what the last test is.
Very elegant! Thank you
This comment is hidden because it contains spoiler information about the solution
maybe I'm wrong but that solution is not correct.
look what happens with this test case - longest(['f', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'k', 'l'], 2)
the result should be - 'b' but it is 'f'
I'm having the same issue, I even put 253 in as a test case and it passed fine. I'm using JS and my code is
return integer + " is prime";
From Kata details: "When words have the same lengths, treat them in the order in which they exist in the array."
Because array is changing during sorting in js,
arr.slice()
is necessary before.sort()
forarr.indexOf()
correct working.(Sorry, i speak English poorly)
Thanks for your feedback and time solving this kata.
It's "bad" pratice to modify the input... and I told it in the description. Didn't you see it?:-)
Loading more items...