Ad
  • Custom User Avatar

    Concatination in loop will create a lot of unnecessary string objects, which will affect performance. Use StringBuilder for adding Strings

  • Custom User Avatar
  • Custom User Avatar

    I am quite disappointed with the all solutions of this kata, since in my opinion the main and only difficulty was precisely in using the string builder correctly instead of string concatenation.

    For example, in one of the worst cases, getPINs("55558888") will produce up to 97 thousand extra String objects because of string concatenation."