Not able to compile
hey @abhisheksingh80511
commented one unbalanced β}β and copy of main() :https://ide.codingblocks.com/s/354603
If this resolves ur query then please mark it as resolved 
still code is not working, please check it
Hey @abhisheksingh80511
Updated ur code and mentioned the change in comment: https://ide.codingblocks.com/s/354617
But its still wrong because
say
aabaa
for this output should be a2b1a2
and ur code will give a4b1
Correct approach :
- Take the first character of the present string and store it in say βchβ. Start iterating over the string and obtain the count of this character occurring consecutively from this point.
- Obtain the answer for remaining string recursively.
- Return ch+countOfCh+recursiveResult .
for(int i=0;i<256;i++){ if(arr[i]!=0){ cout<<(char)i<<arr[i];//updated this line } }
actually this line is very time consuming, is thier any thing that we can do with the loop of ( size of string)
and also some test case are failing in that
Instead of above u can use
for(int i=0;i<size;i++){
β¦if(arr[i]!=0){
. . . cout<<s[i]<<arr[s[i]];
β¦ . arr[i]=0;
β¦}
}
I already told u ur logic is incorrect
Refer to this
The change I told u is according to ur logic