forked from csfx-py/hacktober2020
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcookoffjuly1.cpp
More file actions
52 lines (40 loc) · 789 Bytes
/
cookoffjuly1.cpp
File metadata and controls
52 lines (40 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <iostream>
#include<bits/stdc++.h>
#include<string>
using namespace std;
int main() {
// your code goes here
long long T;
cin>>T;
long long n;
if(T>200){
return 0;
}
while(T-->0)
{
cin>>n;
string s;
cin>>s;
map<char,int>mp;
for(int i=0;i<n;i++){
mp[s[i]]++;
}
int flag1=0,flag2=0;
for(auto it=mp.begin();it!=mp.end();it++){
// cout<<it->first<<" "<<it->second<<"\n";
if(it->second%2==0){
flag1+=1;
}
else if(it->second%2!=0){
flag2+=1;
}
}
if(flag2==0){
cout<<"YES"<<"\n";
}
else if(flag2!=0){
cout<<"NO"<<"\n";
}
}
return 0;
}