Source Code
#include <bits/stdc++.h>

using namespace std;

int main()
{
	int t;
	cin >> t;
	while (t--) {
		string s, ss = "ABCDEFGHIJKLM";
		cin >> s;
		sort(s.begin(), s.end());
		if (s == ss) {
			cout << "YES" << endl;
			continue;
		}
		cout << "NO" << endl;
	}

	return 0;
}
Copy
Well-indexed? Mohamedmaher
GNU G++17
48 ms
724 KB
Accepted