Source Code
#include <algorithm>
#include <functional>
#include <iostream>
#include <numeric>
#include <random>
#include <string>
#include <vector>

using namespace std;

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

  return 0;
}
Copy
Well-indexed? m-salti
GNU G++17
30 ms
560 KB
Accepted