I am not able to solve this problem

please give some hint

iterate over the string and for every adjacent if they are same increase cnt and if not print the character then cnt and continue the process @agarwalarjit.agarwal
try it and if any problems tell me .