greedy algo, add more words in a line and insert the spaces