Infosys Interview Question

word frequency in string