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.
I am not sure:-) This example is explained in the description.
In your code, before returning your array, print it to see what happens. Instead of returning "null" your code returns
[101, 107]
which is wrong (I tried your solution with a correct printing of the returned array); you should read carefully the complete description.It's not garbage; it's the way that Java prints array...
If you don't know how to print array as a string google "java print array". Good luck!
@realJarJarBinks
Does returning null for the (6,100,110) test case cause that problem for you as well?
I flagged your code as spoiler and indeed I was too quick to do this, but I did not do this because it was code. I was convinced that this kata is missing random tests in Java (I remembered this wrong), and I thought that your example simply solves the kata by counting the test cases. It's not the case here, so I un-flagged the comment.
However I think I am still missing something, because I do not see how this example helps and how it addresses OPs question. It passes sample tests, true. But what exactly does it prove about the full test suite?
How is a hardcoded example of the tests behaving correctly a spoiler? I'm unsure why that was flagged, and I think it was a useful addition to a spoiler-free discussion. It seems like someone saw code and assumed it was a spoiler without even reading the code.
This comment is hidden because it contains spoiler information about the solution
what language are you talking about?