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'm just missing some error message in the Test Cases, would be nice knowing what the input was that I failed on.
Thanks, I fixed with your review
private
.Thanks for the review, I already edit this version with your observations.
Rejecting as superseded by https://www.codewars.com/kumite/643681a1b6eeb201fbfa2609?sel=6465e68605eaef004b4b83dd
Rejecting as superseded by https://www.codewars.com/kumite/643681a1b6eeb201fbfa2609?sel=6465e68605eaef004b4b83dd
Rejecting as superseded by https://www.codewars.com/kumite/643681a1b6eeb201fbfa2609?sel=6465e68605eaef004b4b83dd
Rejecting as superseded by https://www.codewars.com/kumite/643681a1b6eeb201fbfa2609?sel=6465e68605eaef004b4b83dd
Issues:
@Tag
annotation is not the one which sohuld be used hee, it serves different purpose. I think what you are looking for is@DisplayName
?System.out.println
. If you want to present inputs (which is very good thing to do), it's better to use custom assertion messages, or test titles.convert
) should be private, or even better, a local lambda accessible only inrandomTests()
Stack
is not used anymore, but it's still imported. The import can be removed.Suggestions/code style:
for (Integer number: numbers)
is unnecessary? Wouldn;t thefor (int number: numbers)
suffice?new Random()
on every iteration is a waste. Just create one instance before the loop and use it.random.ints(lo, hi).take(len).toArray()
to generate an array of random ints, instead of looping explicitly.TODO
note in submission tests is unnecessary.Stack<T>
should not be used in this case anyway andDeque<T>
is preferred.It's Java not JavaScript. You got java.util.Random, no need for
(int) Math.floor(Math.random() * (10 - 1 + 1) + 1)
when you can call
nextInt(1,10)
on a Random.Isn't (10 - 1 + 1) just 10?
And please handle your raw types,
new Stack()
should benew Stack<>()
f.exJava translation here.