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.
.
Correct me if I am wrong: the String.split will find the pattern, remove it and keep left and right side.
So every 2 chars, split will remove pattern, keep left side (just got removed) and right side.
The trick here is that thanks to the capturing groups (?<=) + \G, pattern is reinserted(?) or pattern becomes "what's in between 2 chars" (?).
Still trying to figure it out.
"Once one knows the language" Thats the entire reason why i do these. First I solve them just making it work (Python), and then i look at the solutions of the pros and feel like an idiot, but it gives me real world exapmles of how to actually use the conventions of the language versus trying to do everything the way id have done it in another language. And I dont have to try and create code for a useless program and not have any idea if I could have done it more efficiently. Idk if that makes sense.
This comment is hidden because it contains spoiler information about the solution
Hey,
There is a similar kata to this one, which is ranked 4 kyu, which asks for a harder task to convert back from the roman to the arabic dates. It might be worth adding link to it. Thanks.
I learned a lot about leaps years thanks to suggestions. As long as one considers the Proleptic Gregorian callendar, the formula is still correct. Therefore, I agree it should be added in the descritpion.
Java Translation is ready to check.
I see, I'll change all the messages. And thanks for pointing at the IntXXX specific implementations.
I decided to put all tests in one method. This way all groups are executed sequentially. I wanted random tests to get executed only if all fixed tests get passed.
There are special
Function
andStream
implementations forint
:Stream<Integer>
-->IntStream
Function<Integer, Integer>
-->IntUnaryOperator
Predicate<Integer>
-->IntPredicate
The assertion message should specify exactly which year failed the test and not a general "Your function gave a wrong result on one of the inputs." So do the assertion directly where you check the solution for a single input and not
assertTrue(allMatch()
.Thanks. I can't do that now but I'll add random tests ASAP.
EDIT. This is my first translation, so I hope I have understood the concept and added correct random tests. Thanks.
There are no random tests. Please add them.
kyu7 is IMO right level.
I found the kata very cumbersome. I read an article on Wikipedia to test against Primality and tried the rules like searching numbers lower than sqrt(n), only odds, etc. but it still failed on skip = 1,000,000 and limit = 10. I don't know why it took so long and have no idea how to skip things in Streams! Then, I found, again on Wikipedia, Sieve of Atkins. It's faster. I don't know if this is a proper training. I colved the kata but there are parts of the algorithms I still don't understand.
dude thanks! it relieves
Loading more items...