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.
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!c
What language?
Hey boss! I pass the basic tests, but I fail to pass the complete test while I believe the results are correct.
for instance:
< Incorrect Result >
array = {0, 0, 10, 9, 7, 0, 0, 6, 5, 0, 0, 0, 0, 1, 0}
Submitted: 38
Expected: 21
< Incorrect Result >
array = {0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
Submitted: 17
Expected: 0
Random_Tests
< Incorrect Result >
array = {0, 0, 0, 0, 7, 0, 0, 0, 0, 3, 2, 0, 0, 1, 0, 0}
Submitted: 13
Expected: 2
please respond if needed we can chat in discord!!
Approved
Scala translation
Approved
python new tests frame work
When i first looked at the problem i said too easy.. i can solve this in 1 minute.. it took me 30 minutes, dont underestimate any problem guys, anyways, pretty fun!
Approved.
Java Translation I guess https://www.codewars.com/kumite/643f12adef8153214538a00b?sel=643f12adef8153214538a00b
I had a quick question this: const int array[length]. If the array was 5 elements long then this would give you const int array[5], which would be out of range right? Please let me know if I am incorrect. ALso, are we supposed to alter the parameters at all or is it expected to use what is there?
Thanks.
edit: I am working on the C version.
Loading more items...