String Compress

question- https://hack.codingblocks.com/contests/c/509/1371
code- https://ide.codingblocks.com/s/37634

the character which occurs only 1 time must be printed as but not 1
how can I handle this thing?

just put an if check… if count==1 then don’t print the count.

I have tried this but it won’t happen

Then may be you aren’t doing it correctly… as this is the most feasible way to handle this case.

code- https://ide.codingblocks.com/s/37677

have I done this correctly?
still not getting the desired output pls help

You haven’t checked in your code if count==1 or not. Update line : 24 as
cout<<ch;
if(count>1){
cout<<count;
}

ooohhhh right…thank you soo much