Help me in solving BSHORT problem

My issue

is this approach wrong??

My code

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

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--)
	{
	    int n;
	    cin>>n;
	    
	    string s="";
	    cin>>s;
	    int ans;
	   
	       if(s[0]==0){
	           ans=1;
	       }
	       else{
	           ans=0;
	       }
	   
	    
	    for(int i=0; i<n ; i++){
	        ans=ans^s[i];
	       
	    }
	    
	    cout<<ans<<endl;
	}
}

Problem Link: Small, Smaller, Smallest Practice Coding Problem