Untitled

mail@pastecode.io avatar
unknown
plain_text
3 months ago
703 B
3
Indexable
Never
#include <iostream>
#include <map>

typedef long long ll;
using namespace std;

map<char, int> mp;

int main(){
    freopen("BAI3.INP","r",stdin);
    freopen("BAI3.OUT","w",stdout);

    int q; cin >> q;
    while(q--){
        int n, k = 0; cin >> n;
        while(n--){
            string s; cin >> s;
            for(int i = 0; i < s.size(); i++){
                if(mp[s[i]] == 0) mp[s[i]]++;
                else mp[s[i]]--;
            }
        }
        for(auto it : mp){
            if(it.second){
                k++;
                break;
            }
        }
        if(k) cout << "NO" << endl;
        else cout << "YES" << endl;
    }

	return 0;
}
Leave a Comment