Can you pls me the logical error in my code
String compression question
@amitqy you are printing the global frequencies of the elements, but you just need the frequence that is occuring locally, ie not in the entire string but in that particular segment only
is I can see from the test case given, they not repeated a set of same characters again. So global approach should worj
@amitqy for sample input
abcb
your output is a1b2c1b2
but it should be a1b1c1b1
so clearly your approach is wrong
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.