Getting error in this question

#include
#include
using namespace std;

int main() {
int t;
while(t–){
string s1,s2;
cin>>s1;
cin>>s2;
if(s1.compare(s2)==0){
cout<<“YES”<<endl;
}
reverse(s1.begin(), s1.end());
else if((s1.length())%2==0 && s1.compare(s2)==0){
cout<<“YES”<<endl;
}
else{
cout<<“NO”<<endl;
}

}

return 0;

}

hello @mansi25

the property that they have defined is recursive i.e u can apply the same logic on a1,a2,b1,b2 as well.
so use recusion to check the equivalence of the string.
ss

please solve my doubt

your approach is wrong.

read the definition of equivalence again.

but output should also come with this logic also no because it is alsocheckng the same condition

so can u sendme thecode with required logic please

check this->

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.