Bloomberg interview question

String manipulation problem using hashmaps