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.
In operators:
if (a[i] != b[j]) {
difference.add(a[i]);
You output element a[i] as many times as it does not match the elements b. And it must be equal to 1 time, and then only if it does not coincide with any of the elements b.
Found the instructions for this needlessly overcomplicated, I somehow bumbled my way to a solution in the end.
You can just convert the original inputs to
Set
and find their differences instead of storing it in a new variable beforehand.it's so easy for me. I'm very happy to improve my logic in javascript with codewars
i solved it
test case a = [3, 4, 5] b= [1, 2, 3, 4]
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
way too simple, but i guess the point was to get people to explore their 'clever' side
Not a kata issue
OP solved it, closing
How can I resize 'a' array?
Hi! I can`t pass random test. I have got error: array lengths differed, expected.length=6 actual.length=81; arrays first differed at element [0]; expected:<18> but was:<0>
In IDE everethings work good. How can i fix this?
How is this kata a 6kuy? This is too easy.
use the array filter
Loading more items...