Spaces words on a line using both iterative and recursive Dynamic Programming.