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.
This comment is hidden because it contains spoiler information about the solution
The Submit tests only test for the element at index 1 when the input array is
null
- it should also check that the element at index 0 is0
in that case.As far as the current test goes I can return
new int[] {1, 1331, 2, 3, 4, -1, 0}
and the test will still consider my result correct.Please use
assertArrayEquals
in place ofassertEquals
so you can test equality in one, single test that will ensure the content is always equal.Is the null test necessary? What does it even achieve?
By how the kata is defined the number will be out of the range of an
int
(and even along
) very quickly. The return type should beBigInteger
.Your tests organization makes no sense. Why is there a non-null test in the
testNullability
?needs random tests. ;)