here is the code:
Unable to solve this question
this is not working for
nomatterhowbusyyoumaythinkyouareyoumustfindtimeforreadingorsurrenderyourself
toselfchosenignorance
\
this line is creating an issue
a) u r storing int to a char , which will not work everytime(if count become 2digit then c[i] will not be able to store).
refer this->
- 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 .
i want that it does not compress the string rather it simply display the frq with the letter
then declare ur c array as int instead of char
i don’t get that like how would i display string please explain via code :
@vketan182
see ur ur c array cannot store both character and integer right?
so the solution is to convert ur count integer to string and then append that to ur c char array .
ur updated code->
i guess there is some miscommunication i said that for example, the input is
aabbccd
the output be like
a2a2b2b2c2c2d1
this is incorrect output, in output u dont have to repeat character and count.
pls check output format
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.