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.
No, please remove all stuff specific to this Java translation (especially
null
and negative inputs) and make this translation conform to the other languages.C++ Translation
Yes, I've been careful to put it in a Java-only block so as not to alter the specification of the problem
Before you change the description, and, in consequence, specification of the problem, make sure that the existing translations agree on the new reqs.
Hi! Thanks for the feedback.
Well, It's true that it doesn't mention anything, because in the initial kata it didn't specify that case, except in the last example. But that input is indeed considered and valid.
I will specify it at the description and also I can instantiate a single static Random for the performance problem.
k > len(nums)
. Is this a valid input for this problem?new Random()
called for every call ofrand
is a performance problem. It should use either theThreadLocalRandom
instance, or an instance field of the test class, and not recreate it on every call.Java translation