#include <iostream>
#include <vector>
#include<algorithm>
#include<string>
using namespace std;
class Solution {
public:
bool isAnagram(string s, string t) {
int appear1[26], appear2[26],flag=0;
for (int i = 0; i < s.size(); i++)
{
appear1[s[i] - 'a']++;
}
for (int i = 0; i < t.size(); i++)
{
appear2[t[i] - 'a']++;
}
for (int i = 0; i < 26; i++)
{
if (appear1[i] == appear2[i])flag++;
}
cout << flag << endl;
if (flag == 26)return true;
else return false;
}
};
int main()
{
string s = "anagram", t = "nagaram";
Solution a;
cout << a.isAnagram(s,t) << endl;
return 0;
}