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.
@nef4r1us
1.) Your variables
positiveCounter
andnegatives
are global; this means that the functions will change each function call. You need to put them in a local scope (inside the function) so that they are "reset" and don't accumulate with time/function calls.2.) You need to add a null check and an empty array check at the start of the function. Description states
If the input array is empty or null, return an empty array
. Use an if statement and check if the input is null or it is empty (make sure the null check precedes the empty array check so errors won't occur).i don't know too. You said nothing, what's exactly wrong?
Why not?