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.
Description Suggestion JavaScript
If the input array contains anything other than integers, then return undefined.
Iterate through the array cubing each element meaning e3 or
e*e*e
.Grab only the odd cubed elements and return the sum.
but
so, what if number is float (not equal to its integer part)? It is a number, but it is not an odd number (even or odd are defined only for integer)
Seems like, text might be
"The function should return undefined/None/nil/NULL if any of the values aren't integers"
and there must be any test with float (at least there are none of those in python version)
y, errors in test:
assertEquals(0, FindOddCubes.cubeOdd(new int[] {-3, -2, 2, 3})); Must be -19(-3^3+2^2=-19, not 0); expected:<0> but was:<-19>
Maybe it's just me, but I found the wording "the odd numbers" confusing. I thought it meant the odd array entries (ie the 1st, 3rd, etc). It was even more confusing because the first test case gives the same answer. Maybe shuffle the the numbers in the first test case, or make it clear you mean the numbers that are odd.
This comment is hidden because it contains spoiler information about the solution
I saw some of the "correct anwsers" and they should not be accepted.
Please, someone write this test:
Edit:
This chanllenge needs to be rewriten if you really want to return
undefined
if any of the values aren't numbers.