PayPal interview question

Theoretical algorithmic question about adding spacing to a string.