Remove duplicates in strings

https://ide.codingblocks.com/s/69762
code is correct for sample input but not for all test cases why??

I’ll give you a hint where you are going wrong…
Try this test case: aaaabbbb

So how to do put the output i am getting again in the recursive loop.I am not able to think of it .Plz tell.

I’ve made changes to your code…check it out here

Hey Dhruv,
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.