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 doesn't handle null check . what is str is null ? your code throws NullPointerException
This doesn't handle null check .
what is
str
is null ? your code throws NullPointerExceptionThis comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Yet, this mutation is quite harmless for it adds an additional element and it doesn't actually modify any existing data. In that specific case, I would assume that adding data is actualy the requirement rather than not.
Shouldn't that technically be wrong bc if "yourPoints" are equal to the average it should be flagged as false (Kata description says only true if "yourPoints" are higher).
did you read the kata description?
Awesome solution!
This is what I attempted
thanks!
corrected
(Cough):
In Java, random tests don't compare a user's solution with an expected solution:
you are absolutely correct, using a pattern as static variable is about 3-4 times faster.
Correct me if I'm wrong but isn't this solution kind of inneficient in terms of performance in a high concurrency scenario??
The thing is that everytime you invoke String.matches it has to compile the regex before evaluating the String. If you compile
the regular expression in advance using an static variable with Pattern.compile() it will perform way better than this solution.
Isn't it?
Regards.
Loading more items...