IBM Interview Question

String problem based on using a hashMap