Whats wrong please can u check?

#include <bits/stdc++.h>
using namespace std;

char* removeDuplicate(string s, int idx, int j, char* out){

if(idx>=s.length()){
	out[j]='\0';
	return out;
}

if(s[idx]==s[idx+1]){
	out[j]=s[idx];
	return removeDuplicate(s,idx+2,j+1,out);
}
else{
	out[j]=s[idx];
	return removeDuplicate(s,idx+1,j+1,out);
}

}

int main() {

string s;
cin>>s;
char ans[10000];
cout<<removeDuplicate(s,0,0,ans);
return 0;

}

Hello @talhashamim001 your code is passing all the test cases:
refresh and try to submit then


if you have any doubt you can ask here:
Happy Learning!!

same code not working here I guess problem in backend then

@talhashamim001 what is the problem you are getting?
could you please elaborate?

test cases not passing

@talhashamim001 are you still facing this problem?

yes still not passing

@talhashamim001 to submit here:
https://hack.codingblocks.com/app/practice/1/200/problem

thank you done …

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.