Anonyme interview question

string repeated element and count of repeatation