Whats wrong with my code?
hello @akash_281
u need to compress only consecutive same character.
for example->
aaabbcccb
output should be
a3b2c3b1
check ur updated code here->
Your code was giving segmentation fault because of line 13.
Change it to for(int j=i+1;j<n;j++)
Also you are not printing the result in desired format.
for example->
aaabbcccb
output should be
a3b2c3b1