IBM interview question

String problem based on using a hashMap