• + 3 comments

    When you get time-outs, you are probably trying to construct the 'infinite' string based on the amount of chars you need. Don't do this, but instead count the number of 'a's in the original string and then multiply this till you get to the target. The remaining part of a string can be calculated then.