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.
I could be wrong (still learning Java), but doesn't this have high time complexity (lines 8 and 9) compared to other solutions?
Kata should be updated to make explicit for languages like Ruby that mutating the original string is disallowed (otherwise the random tests break).
I get that it's often best practice, but it's not obvious from the instructions or the sample cases.
This 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
this might have a little more overhead than the top answer, but the intention is much much clearer.
This comment is hidden because it contains spoiler information about the solution
3791ms here after first timing out with a more naive method. People concerned about timeouts need to consider not whether the tests are broken, but whether they can reduce the time complexity of their solutions.
This 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
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution