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.
Test case was deleted.
done
done
done
done
done
done
done
done
done
Your code is wrong. Not a kata issue.
If you meant there should be fixed tests for that, then read this
Added fixed edge tests to javascript, you'll see your code fails all of them.
This will fail any time the array contains duplicates, as you're finding the min and max integer in the array, then filtering them out. So say the array looks like this [1, 3, ..., 98, 99, 99], your first iteration will use (1, 99) for minValue and maxValue, but your second would use (3, 98) as the other 99 has been filtered out. Try using array position instead of value.
When
sumOfArrEl([18])
is called, your function returns[18]
, but it should return 18.Remove the
throw
line, the rest of your code won't matter otherwise. Then read the test label of the test that will fail, it'll give you a hint about what you're doing wrong.