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 comment is hidden because it contains spoiler information about the solution
I disagree!
The task is to fix the code, not to rewrite it.
I meant to entirely replace StringBuilder by
new String(value, 2);
I would have to profile it to see how significant the difference is, but calling new String just to produce a two-character string, append it to a StringBuilder, and then throw it away to be garbage collected later might be more wasteful, of memory certainly, but possibly also of CPU, than two calls to Append. StringBuilders are optimized for many small incremental additions...they try to minimize the number of memory allocations. But making new objects over and over again to hold two bytes of data seems like the worse decision to me.
This solution modifies the original input, which should not happen.
misses theme, sit down, six :(