EVENTUAL - Editorial

hey folks , can somone tell whats wrong with this approach :sweat_smile:

#include <iostream>
using namespace std;

int main() {
	int t;
	cin>>t;

	while(t--){
	    int n ;
	    string str;
	    cin>>n;
	    cin.ignore();
	    getline(cin,str);
	    int *ar = new int[26];
	    
	    bool *visited = new bool[26];
	    for(int i =0;i<26;i++){
	        ar[i]=0;
	        visited[i]=false;
	    };
	    
	    for(int i =0;i<n;i++){
	        ar[str[i]-'a']++;
	    }
	   int c = 0;
	   for(int i =0;i<n;i++){
	       if(!visited[str[i]-'a'] && ar[str[i]-'a']%2==0){
	           visited[str[i]-'a']=true;
	           c+=ar[str[i]-'a'];
	       }
	   }
	   if(c==n){
	       cout<<"Yes\n";
	   }else{
	       cout<<"No\n";
	       
	   }
	}
	return 0;
}

it was mistake of outputs though :joy:

This is the best possible code for this Question, especially after reading the 4th input of sample Input
#include <bits/stdc++.h>
using namespace std;
void yourcrushlovesyouback(){
string MyCrush;
int HerCuteness;
cin>>HerCuteness;
cin>>MyCrush;
int DaddyIssues[26];

memset(DaddyIssues,0,sizeof(DaddyIssues));

for(int MyCharm=0;MyCharm<HerCuteness;MyCharm++)
    ++DaddyIssues[MyCrush[MyCharm]-'a'];

for(int SheSaidYes=0;SheSaidYes<26;SheSaidYes++){
    if(DaddyIssues[SheSaidYes]%2==1){
        cout<<"NO\n";
        return;
        cout<<"SHE SAID NO!"<<endl;
    }
}
cout<<"YES\n";
return;
cout<<"SHE SAID YES!"<<endl;

}
int main() {
// your code goes here
int MyConfessions=1;
cin>>MyConfessions;
while(MyConfessions–>0)
yourcrushlovesyouback();
return 0;
}