In question were if we have to find the i/p as aaabbaabba as a6 b4 slight change in the given code which approach should i have to use?
@kailash_01
just maintain an array of size of 26 to store frequency of each character .
now iterate array print character and its count.
example-
let say string is aaabbaabba
frequency array will be
char. a b
count 6 4
now iterate this array
a6b4
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.