Agilysys interview question

string manipulation like finding duplicate and counting their repetition