LinkedIn interview question

Coding problem to reformat input string.