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.
Can't be changed.
At first I thought of this solution as well. However, take into account that the parameter is long for some reason. In real life applications this would be a code smell. This is not a safe cast as you have no control over the argument at runtime. At some point, a client may pass a long, as the type parameter is long, and then the casting will fail with an overflow of the long value.
description has been updated.
Java was updated on Codewars only a couple of months ago, so the solution hasn't had much time to collect votes.
I appreciate the feedback. I'll take time to evaluate the downfalls of the description to prepare a more comprehensive explaination of the task at hand.
Cheers.
That's why I immediately return False inside the loop. It stops execution and True is never returned.
oooooomg, what is this solution...? X/ (and why is it upvoted!?? X//)
The loop is not needed.