Break a string into lines of length k without breaking words

medium