Can anyone help me in writing code in python for string manipulation string is
string = aaabbcccaa
output will be
a3b2c3a2
Can anyone help me in writing code in python for string manipulation string is
string = aaabbcccaa
output will be
a3b2c3a2
Here is a tip to get you started:
1) Find the length of the string
2) Iterate over the string
3) Use a dictionary to record the count of the letters
4) Iterate over the dictionary to print the result
Hope that helps :)