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.
"...removes all exclamation marks..."
Future over-engineer spotted.
number 1 for test < 18.5 and < 25 and < 30
Insane solution!
brazy crazy
Whenever possible, use switch is the best practice. Firstly, readability, and secondly, switch works more efficiently than if - else chains, since with if else the performer does not know in advance which condition will suit him, everything is calculated in runtime, but when using switch, the performer almost instantly chooses what came up according to the condition :) Good luck in your studies!
"You will be given a list of strings. You must sort it alphabetically ...
You should not remove or add elements from/to the array."
Great solution!!
This comment is hidden because it contains spoiler information about the solution
Single exit strategy is a controversial discussed dogma. For instance the Object.equals() method uses multiple return statements. Just have a look at the source code. Perhaps you shall advise Oracle that you think they're using bad pracice and improve the Java code base with a better solution. Your approach may be good for these concrete kata, but it is indeed not a general valid way, to solve all problems of that type, as you can see.
Hence, my question was not about linking connections to anything, but wanting to know, how you would solve problems of that kind in general, if something like IntStream was not accessible. Since clairvoyance does not exist, nobody can elaborate how your solution would look like. This is just a red herring argument. I would be grateful, if you could take two minutes to show a good way that works even for cases when Streams don't work, with a single exit point. And of course, without a break in the loop, because it violates your choosen strategy.
If it was a replay to my comment can elaborate on your thought. I'm not sure that I've understood correctly what you are trying to convey.
What is the connection between import statements and best coding practices?
This comment is hidden because it contains spoiler information about the solution
Apart from the weird formatting multiple return statement is not a best practice.
This comment is hidden because it contains spoiler information about the solution
I'm wrong or this code change the original Array? 🤔
Loading more items...