题目链接:https://leetcode-cn.com/problems/valid-anagram/
题目描述:
题解:
class Solution {
public:
bool isAnagram(string s, string t) {
unordered_map<char, int> map;
if(s.size() != t.size()) return false;
for(char c: s)
map[c]++;
for(char c: t)
if(--map[c] == -1)
return false;
return true;
}
};