+ 1
In python, given a string, create a new string with all the consecutive duplicates removed
Example: Input: AAABBBBCDDBBECE Output: ABCDBECE can anyone help me to solve this?
3 Answers
+ 2
Ashir Rahman
You have to try it out first. It is a good way of learning.
If you have, then link your code here.
+ 2
Hint: use a for loop and append current char in new list if it's not like prev char
Join the new list
+ 2
Aman Kumar
Please make sure your code is working right before posting answersđđ