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.
handled
That means incorrect solutions pass the tests.
https://www.codewars.com/kata/reviews/54b68cae11ac24e93900008c/groups/5bf125a829354d3ad9000210
My solution doesn't account for such a possibility; I've just ran 10k random tests, and didn't fail once...
Is this an actual issue? The description explicitly mentions "two array elements", but not "element can be added to itself":
This is a duplicate.
@cliffstamp So you've just confirmed the issue and closed it? The random tests can generate it, but they don't do normally.
The randoms can generate it.
.
.
.
just came here to post the same issue.
None of the tests check for a number plus itself for example
Test.assert_equals([1,2,3,4], 2), false
1 + 1 = 2 is true, but the number 1 only appears once, and should not be added to itself
The second test case was checking
[], 1
instead of[], 0
which should return false.Fixed the error message.
An empty array will only return true when the sum required is zero.
Added an example in the description.
Random tests added.
Could you resolve the issue if the test cases are good now?
too few test cases allows answers that would fail the requirements with certain arguments.
Loading more items...