和赎金信的思路一样
我想我本科时光是找不到女朋友了,哪怕是一个异性的好朋友也不会有了,男女比例4:1,哼
class Solution {
public:
bool isAnagram(string s, string t) {
int table2[26]={0};
for(char a:t)
{
table2[a-'a']++;
}
for(char a:s)
{
table2[a-'a']--;
}
for(int a:table2)
{
if(a) return false;
}
return true;
}
};
END