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.
this is really optimised!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
It's not more readable ... take a look at the next comment asking for what (-_) does ... but it is a cool and clever solution !! ;) :)
This comment is hidden because it contains spoiler information about the solution
Short, but not very efficient - it first sorts the full string, even for strings like 'ba....'
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Thanks for your comment. As you see the string is converted to lowercase at the start and since vanilla java doesn't have pythons zip() it starts with an IntStream range() to determine wether the current character is in an odd or even position - eda so after that I had to deal with upper and lower case separately (my goal was to put the whole solution into one statement)..nsi
Nice, but it could be shorter - you could convert the string from start to lowercase, and handle in map() only the case for lowercase (as initial case doesn't matter, anyway, in the end). And converting the even positioned chars in uppercase at the end seems a stretch done like this (instead of using Character.toLowerCase())
This comment is hidden because it contains spoiler information about the solution
Nice, first recursive solution I see here (not super efficient, but nice). As a note, you could have skipped storing inhab as a separate variable and having if logic over it, at the cost of 1 more iteration :) - check my solution.. (I wrote it for fun in Scala then translated it in Java)
This comment is hidden because it contains spoiler information about the solution
nice :).. using that toUpperCase at the end to avoid another 2 replacements...
This comment is hidden because it contains spoiler information about the solution
Loading more items...