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 was on vacation the last weeks, I'm sorry for not answering any questions. I think everything should be resolved now?
Hey, I'm not sure what I need to do. Do I have to check anything in Kotlin or Java again?
If i create a fork of Unnameds Java translation and want to save it it says "must be unique from parent". I'm not sure how to do it...
I'm pretty new at CodeWars and still a little bit confused how the Kumite system works.
Looks good, I agree.
Should be working now.
For some strange reason there is no Kotlin version selected and i can't select one anymore.
Gonna check it tomorrow.
Python 2 is pretty different from python 3 based on syntax.
F.e. python 3 uses next(gen), python 2 used gen.next()
I think python 3 is enough here.
Though I don't like python, translating to python was much easier than to java :D
Well, it's finished.
Problem or feature (depending on case) is that java is typesafe.
So if your function says it will return an integer, your function must always return an integer.
Am I right you prefer the last one?
Reason is, that Java is compiled and JavaScript is interpreted.
Funny things like
hi+array[-1]
resulting inhiundefined
are not possible in Java, as it wouldn't even compile.Imp it's ready, but not sure which of those options is the prettiest:
Also, to get rid of the
return -1
we could replacecase 3: return gen.next();
bydefault: return gen.next();
But I'm not sure it this makes the intention of the switch more unclear.
More specific:
20 and 100 tests work the following: Get 20/100 first elements from generator, compare them with getElementAt(i), with i >= 1.
Random test creates an array with first 1,000,000 items. (Array indices from 0 to 999,999, both including).
And i just realized, you are right, there is an off by one error, fixed the test.
We then generate 100 random numbers i from [0; 999,999] and check the item at position i with the getElementAt(i+1), as getElementAt starts at one and our array starts at zero.
I start testing from one.
I'm not sure about changing
gen == null
toi == 4
.It's kind of best practice, as it's a check if gen is already defined like "already defined? NO? => then init now".
Loading more items...