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.
Lua translation!
LC translation
Haskell translation
Rust translate
though i came to the conclusion that it was my flawed interpretation at the end, the description indeed is clearer now, thanks!
I'll add that other example if you think that'll make it clearer.
so what? lets say you have for instance [3, 4, 3, 3] instead
so last two 3's are mutual duplicates of each other, therefore first 3 has no duplicate.
cant it be interpreted like that, or it's just me? :)
maybe i should look into "duplicate" definition, idk...
You can see from there that no 3 is counted.
maybe the description could be more clear - you could say "ignore numbers that appear more than once in array"
i thought sum of array [ 1, 10, 3, 10, 10 ] should ignore only last two 10's, and not the first one, cuz it technically might not be a duplicate
anyways, had fun! (mostly cuz of me misunderstanding the task)
This is pedantic but the description does say:
Although the test cases doesn't test for the amount of parameters, this solution would technically be incorrect as it accepts 0 to N parameters.
I understood it like i had to sum it but ignore any duplicates of a value that we had already seen, not ignore both of them.
OP solved it, closing
@RealDeepazz this is because you are modifying the original array. The kata currently has a function declaration with this array designated as
const
, so it should not be altered whatsoever. Perhaps copy your code (to save it), refresh the kata trainer, then work on an algorithm that does not mutate the input. If this declaration was in fact given to you with theconst
designation and if you then changed that so you could replace any of its contents... well, don't do that!Loading more items...