LinkedIn Interview Question

Coding problem to reformat input string.