#include

using namespace std;

#define ll long long

void ret(string s,string p,ll n){

int sPart[2] ={0};

int pPart[2] ={0};

for(ll i=0;i<n;i++){

if(s[i] == ‘0’)sPart[0]++;

if(p[i] == ‘0’)pPart[0]++;

else if(s[i] == ‘1’)sPart[1]++;

else if(p[i] == ‘1’)pPart[1]++;

}

if(sPart[0] == pPart[0] && sPart[1] == pPart[1]){

cout<<“Yes”<<endl;

}else{

cout<<“No”<<endl;

}

}

int main() {

// your code goes here

ll t,n=0;

cin>>t;

while(t–){

n=0;

cin>>n;

string s,p;

cin>>s>>p;

if(s == p){

cout<<“Yes”<<endl;

}else{

ret(s,p,n);

}

}

return 0;

}

Just try this simple test case

1

3

100

001

Expected Output : Yes

Your Output : No

There is an issue with your counting zeros and ones.

```
if(s[i] == ‘0’)sPart[0]++;
if(p[i] == ‘0’)pPart[0]++;
else if(s[i] == ‘1’)sPart[1]++;
else if(p[i] == ‘1’)pPart[1]++;
```

whenever u get a zero at p[i] and simultaneously 1 to s[i] ur code skips to add the count to sPart[1] because of wrong if else.

I implemented all conditions like this,

if(s[i] == ‘0’)sPart[0]++;

if(p[i] == ‘0’)pPart[0]++;

if(s[i] == ‘1’)sPart[1]++;

if(p[i] == ‘1’)pPart[1]++;

but now all test cases are going to fail in custom input every thing is going well but submission is going fail.