not all char are getting seprate by *
#include<bits/stdc++.h>
using namespace std;
void replaceduplicates(string arr,int i,int n){
if(n==0){
cout<<arr;
return;
}
if(arr[i]==β\0β)
{
cout<<arr;
return;
}
else if(arr[i]==arr[i+1])
{
// hell o o p \
arr[n+1]='\0';
for(int k=n-1;k>i;k--)
{
arr[k+1]=arr[k];
}
arr[i+1]='*';
replaceduplicates(arr,i+2,n+1);
}
else
{
replaceduplicates(arr,i+1,n);
}
}
int main() {
char arr[10000];
cin>>arr;
replaceduplicates(arr,0,strlen(arr));
return 0;
}