Agilysys Interview Question

string manipulation like finding duplicate and counting their repetition