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.
"Useless fuffery!" is amazing and it shows us how much guys just copy-paste solutions))
Isn't that the standard message for that exception? :P
People, if you're going to cheat, at least be sneaky about it. Like I'm going to believe the rest of you originated "Useless fuffery!" independently.
Recursion is a tool. It's good practice when it's the best tool for the job.
It's the best tool for this job.
I have noticed that recursive solutions always get the most upvotes... But aside from looking impressive, are they really a good practice in Java ?
That's called a "ternary operator", and it's basically just a short if statement. https://docs.oracle.com/javase/tutorial/java/nutsandbolts/op2.html
Beginner here,
In the return statement, what does the "?" and ":" do?
Slower for what task? It is unlikely that this will be the bottleneck in your code, and stack operations are incredibly fast. They don't even incur garbage collection penalties. Regardless, such talk is certainly premature optimization. Pick a context that the code will run and then optimize for that. If no context is given, this is solution is using best practices.