Softtek Interview Question

String x="abcghd abkly" Count duplicate character and convert it into ascii value without using c# built in method write your own logic?