Recursion Duplicate character

What’s the error in my code?

CODE: https://ide.codingblocks.com/s/585520

Your recursive calls are going out of string length, causing seg fault. see this one

How to do it recursively?

the code i have attached is of recursion only.

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.