not getting why its not working for last test case
here is my code;
#include
#include
using namespace std;
void duplicatechar(char *a,char *out,int t,int i){
int temp=strlen(a);
if(t==temp){
return;
}
out[i]=a[t];
if(a[t]==a[t+1]){
out[++i]='*';
}
duplicatechar(a,out,t+1,i+1);
}
int main(){
char a[200];
cin>>a;
char out[200];
duplicatechar(a,out,0,0);
cout<<out;
return 0;
}