#include<bits/stdc++.h>
using namespace std;
void val(string str,int i,string &out){
if(str[i]=='\0'){
return ;
}
if(str[i]==str[i+1]){
for(int k=i;str[k]!='\0';k++){
str[k]=str[k+1];
}
}
out+= str[i];
val(str,i+1,out);
}
int main() {
string str,out = " ";
cin>>str;
// cout<<str.length();
val(str,0,out);
cout<<out;
return 0;
}
it’s giving test cases error what should be the modified in this code