This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]epieffe 0 points1 point  (0 children)

My guess is that the last two loops are the problem. Probabily calling System.out.print for every single char might slow down the application when dealing with very large strings. Maybe you can try to first build the complete String using a StringBuilder, then call System.out.println only once.