String compression,

unable to do usng recursion

send me the code i will modify and help you to find your mistake

i m not able to approach using recursion

in the parameters take str, i, ,prev_char , count, out ,j
if prev_char==str[i] increase count
else out[j]=count;

and call recursively for next char (by increasing i)

now try to implement

1 Like


1 case is still not executing

β€˜0’+30=78 it will add ascii values which we don’t want
so we have to use a function to_string()it converte integer to string and then insert it’s character to output array