Hey, I’m getting AC if I’m running code individually, but Getting WA when these test cases are running together, someone, plz help
#include
using namespace std;
int main() {
int t;
cin>>t;
while(t–)
{
int n;
cin>>n;
string s;
cin>>s;
int c=0;
if(n==1)
{
cout<<“Yes”<<endl;
}
else{
for(int i=0;i<n-1;i++)
{
if(s[i]=='1' && s[i+1]=='1')
{
s[i]='0';
s[i+1]='0';
}
}
for(int i=0;i<n;i++)
{
if(s[i]=='1')
{
c=1;
break;
}
}
}
if(c==0)
{
cout<<"YES"<<endl;
}
else
{
cout<<"NO"<<endl;
}
}
return 0;
}