fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. string s, t;
  7. cin >> s >> t;
  8. int freq[256] = {0};
  9. for (char c : s) freq[c]++;
  10. for (char c : t) {
  11. if (--freq[c] < 0) {
  12. cout << "NO\n";
  13. return 0;
  14. }
  15. }
  16. cout << "YES\n";
  17. return 0;
  18. }
Success #stdin #stdout 0.01s 5320KB
stdin
erollH
Hello
stdout
YES