Morgan Stanley Interview Question

String manipulation and frequency of a letter