Cognizant interview question

questions on my project. write a code to count repeated characters in a string