Google Interview Question

String manipulation and dictionaries question.