All test case not passing

#include
using namespace std;
void duplicate(charin,charop,int i,int j)
{
if(in[i]==’\0’)
{
op[j]=’\0’;
return;
}

op[j]=in[i];
if(op[j]==op[j-1] )
{
    op[j]=in[i+1];
    i++;
    if(op[j]==op[j-1])
    {
        op[j]=in[i+1];
    }
}
cout<<op[j];
duplicate(in,op,i+1,j+1);

}
int main()
{
char in[1000];
cin>>in;
char op[1000];
duplicate(in,op,0,0);

return 0;

}
THIS IS THE CODE I AM GETTING THE ANS CORRECT BUT IT IS PASSING ONLY 1 TESTCASE. KINDLY TELL

https://ide.codingblocks.com/s/202190 LINK TO THE CODE

Consider a input:
aaaaaaaaaaa

Your o/p:
aaaaa

Dry run with this and recheck your logic.

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.