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.
Approved
python new test framework is required. updated in this fork
Nice!
Done. Thanks!
Should be fixed by now. Thanks!
Adapted the description to include "non-negative" values and fixed test cases. Thanks!
input is vulnerable to mutation, in the random tests
Your tests never include duplicate values. Better test that as well.
yes, expected and actual are effectively swapped in the random tests. And 0 can show up from time to time in some of those.
that would depend on who you are talking too, unfortunately. That's why it should be told plainly in the description.
Zero isn't positive or negative and shouldn't be "considered" as such. The judge solution uses
>= 0
, so the kata should say "non-negative" instead of "positive".Ah, I forgot one important edge case: what about 0? => you have to tell if you considere it positive or negative (positive, looking at your solution) and put some tests with it. Note that your random tests may not generate any zero, otherwise, ZED's solution would never have passed.
Got this:
I'm sure you confused mine and yours. My solution definitely doesn't include zeros. Because I do what the problem asks, output only negative and positive values.
Thanks, I've added fixed tests that account for all three of these cases as well as random tests for "only negative" and "only positive" arrays.
Hi,
Interesting one.
You should add some edge cases, though: