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 guess that checking for a for-each-loop use in a solution means checking for an
iterator
method call. So maybe you can extendArrayList
(or other implementation to be used as a fn parameter) and overrideiterator
method. Like that:Maybe do the same for some other methods (
get
for example).This kata is supposed to be simple, so I didn't want to complicate it.
Why? Just use
long[]
instead ofint[]
?The description has this:
note that using frequency inside the loop condition is definitely a bad practice: you're computing again and again the same things.
Random tests have been added.
that's not what he's talking about ;)
Publishing a kata lacking some of the required stuff is the best way to get it retired in no time. Honestly, you're just losing your time, doing so, that's too bad.
Yes, I have. I just posted this right now, I do intend on adding random tests soon, but I was on a time limit. This kata was made during a break at a lecture, so I didn't have a massive amount of time to make it.
Hi! This was a mistake, I forgot to remove the lines saying that you had to use streams! My bad!
Author's solution uses a stateful predicate, which does not conform to requirements of
filter
predicate (see docs and some explanation).Hi,
No random tests.
Did you read the documentation about authoring? You really should. You'll realize that this kind of kata as very few chances to survive the beta phase.
Cheers
I've never properly understood how to do that... Do I load the file as a string or something?
How exactly would I check for a for loop?
Probably if you are aiming to use java streams, you should have a method that checks it. I see some solutions using the for loop
My bad! I forgot to hit re-publish!
Loading more items...