3 ms·
While the final recursive solution is nice, it is trivial to split the string on spaces and recombine inserting newlines when the current line overflows. This i
by chewbranca 16y ago
While the final recursive solution is nice, it is trivial to split the string on spaces and recombine inserting newlines when the current line overflows. This is not as elegant of a solution, but it took far less time to build that than it did to read the article.