Question d’entretien chez LinkedIn

Coding problem to reformat input string.