Ad
  • Custom User Avatar

    The algorithmic complexity of the code is atleast linear, but the required complexity is lower than linear.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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

    So, accoring to the task, we have to mutate given string.

    Which part of the task makes you think that this have to be exactly the solution here?

  • Custom User Avatar

    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)

  • Custom User Avatar

    java: the same computation is used, though (except for the abs). Check for another source of troubles?