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.
There's nothing strange here))
I kindly advise you to refine your knowledge of how the String class and its siblings that implement CharSequence interface work under the hood.
Quick answer: every string instance maintains an array of bytes (from Java 9, prior - an array of chars) and it's simply impossible to create an array of length less than 0 or greater than Integer.MAX_VALUE (note that there're far more strikt limits for string literals).
So there's nothing wrong with this solution. And yep, that is good practice.
The actual usage of long type argument in this method is pointless, you have to downcast or may do some tricks) But at the end of the day result is the same.
It's really strange that it works. Cause of long casted to int may return wrong number or even negative number.
This comment is hidden because it contains spoiler information about the solution
If you can't find the trick of this KATA, then in that case this KATA has at least 6 or 5 kyu difficulty level. I didn't find it, but I love that KATA. It's amazing! :)
Can't be changed.
It's a very nice KATA, but the difficulty level of it is a little undervalued. I think 5 or 4 kyus would be the perfect level for it. ;)
This comment is hidden because it contains spoiler information about the solution
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.
This is a terrible solution with a bunch useless steps which are absolutely unnecassary. For example: The "JOIN" part of the query... There was a helper table, called film_actor schema wich was instead of the "JOIN".
Java was updated on Codewars only a couple of months ago, so the solution hasn't had much time to collect votes.
If I had wrote the same code like this I would have been fired from my school... This is a terrible solution, I guess.
I really don't understand why this solution isn't the 'Best Practice'!???? :) Simple and clever... ;)
Re-raised as a more informative suggestion.
I've done a little research and edited my comment to be more descriptive about the problem. Please, check it to see the updated version.
Loading more items...