Bloomberg Interview Question

String manipulation problem using hashmaps