https://ide.codingblocks.com/s/197357 is the logic right becoz code isnt seems to be
Remove duplicates problem
hey @Learning_bunny your logic is almost correct, and your code needs little bit changes
- pass index 1 instead of 0
- add str[i] each time and only add * when str[i] == str[i-1]
Here is your code modified:
second point you are saying is of the previous problem i.e. duplicate character formatting so i guess the first one also might be if the same question. the question for which i am asking is remove duplicate
My bad in that case you simply need to insert abc = abc + str[i] and the return condition following it into a else block
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.