You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please improve two Java-Codelines to avoid performance penaltys:
result.append(times + "" + repeat); // YOUR code creates (finally millions) intermediate StringBuilder'sresult.append(times).append(repeat); // Better: THIS code avoids it - you already have a StringBuuilder
StringBuilderresult = newStringBuilder(); // YOUR code creates Builder with a small (default-sized) buffer which must be increased over and over again while appending charactersStringBuilderresult = newStringBuilder(number.length() * 2); // Better: THIS code directly creates a buffer with expected size
Please improve two Java-Codelines to avoid performance penaltys:
Please note that you also implemented in this optimized way for the C-version: https://github.com/JulesKouatchou/basic_language_comparison/blob/master/C/test_look_and_say.c#L18
The text was updated successfully, but these errors were encountered: