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.
absoluetly I agree with you I think this is odd
I guess it depends on which paradigm you're more familiar with. The top-voted solution uses an imperative approach, while mine uses a functional approach which may come off a bit unnatural because Java's functional features are relatively new. I should have split the calls of
map
andcollect
into new lines (like I did in my fork), but apart from that I still like my solution very much.The biggest problem with your solution are the inline comments. These are generally an indication for code that's not self-explanatory.
This comment is hidden because it contains spoiler information about the solution
Are you familar with Java streams? They're pretty great and is pretty easy to read (given that you know about them of course, they're only there since Java 8).
At least it's infinitely better than tons of for loops and if statements (like your solution does) ;-)
At the risk of being a negative nelly (and admitting that my attempt was pretty simple), I find this solution difficult to read.