Can you give me hints of this problem .
Problem name is “String Compression” .
Can you give the hint of this problem
hello @aasif2364
u have to compress only consecutive same character.
for example->
aaaabba will be compressed as
a4b2a1
- 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 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.