#include<bits/stdc++.h>
using namespace std;
string output="";
string duplicate_character(string input,int i)
{
output+= input[i];
if(input[i]==’\0’)
{
return output;
}
else if(input[i] == input[i+1])
{
output+= '*';
}
return duplicate_character(input,i+1);
}
int main() {
string input;
cin>>input;
string ans = duplicate_character(input,0);
cout<<ans;
return 0;
}
It is not passing any test case but in custom test case it works just fine. Please help