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.
The algorithmic complexity of the code is atleast linear, but the required complexity is lower than linear.
Oh, the code you see in "Initial Solution" box is meant to be completely replaced by your solution. The fact that it returns the same reference it accepts does not mean that you have to do it this way, it's just an example and placeholder. You can do it any way which passes tests, and as you noticed, in Java you cannot mutate the original string. You have to create new one.
You are right, you cannot mutate a string in Java. This kata cannot be solved by mutating the string neither in Java, nor in many other languages, but it can in some others
Which part of the task makes you think that this have to be exactly the solution here?
I just tried your code in a fork and never had any problems, though... :o (apart from the fact that I don't know how you did submit this version since it doesn't compile (unsafe opeartion because you didn't decalre the type the list is holding) x)
java: the same computation is used, though (except for the abs). Check for another source of troubles?