Bloomberg interview question

String manipulation problem in any language