You are viewing a single comment's thread. Return to all comments →
Pro Tip for Java user: Use the StringBuilder class.
String is immutable, so everytime you add to a string, it creates a new object! With an input of 100000, you'd have created 30000 new objects each containing the string it was before it plus what you added to it! You can imagine how innefficient this is.
StringBuilder, 1 object, 1 problem solved. Use StringBuilder today!
(This message is brought to you by StringBuilder Co. We build Strings in a timely manner for you, so you don't have to!)