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.
okay, it seems that the translator fixed the original translation, but this has no effect on the kata. i guess this is the reason for the useless double use of
Math.abs()
I cannot approve yet, the author is active :(
gotta wait 7 days...
okay I forked the kata and I think I fixed it but idk how to get the fix published
Might not be perfect but the sooner we can fix it the better
Yes, this! Especially the second one. I spent hours attempting this kata before realizing the reference implementation is the one that is wrong, not my code.
As long as the test remains broken the way they currently are, the quickfix for passing the broken tests would be to throw out all negative numbers that are also odd.
I'm guessing the mistake made was thinking that
i % 2 == 1
holds for all odd numbers; actually: a negative odd number% 2
== -1This comment is hidden because it contains spoiler information about the solution
Surprisingly fun kata, very enjoyed! The empty array in an array edge case input really confuses me. I was dissapointed when I got the whole thing working except for the empty array in an array test. I guess I don't really understand how to work with an array with only an empty array in it in Java.
I really liked this kata. Some people didn't like the "hardcoding", but maybe some problems genuinely require it and this is a really practical example. Here in Java we've got it down to not much more than a single switch statement (with 30 cases).
This comment is hidden because it contains spoiler information about the solution