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

using namespace std;

int main() {
  string s;
  cin >> s;
  string a = "Atypical";
  auto GetFreq = [](string& s) {
    vector<int> freq(26, 0);
    for (char c : s) freq[tolower(c) - 'a']++;
    return freq;
  };

  auto va = GetFreq(s);
  auto vb = GetFreq(a);
  for (int i = 0; i < 26; i++) {
    if (va[i] < vb[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}
Copy
We Love Atypical MaxHeap
GNU G++17
1 ms
808 KB
Accepted