题目链接:https://leetcode-cn.com/problems/check-permutation-lcci/
题目如下:
class Solution {
public:
bool CheckPermutation(string s1, string s2) {
unordered_map<char,int> umap;
for(auto e:s1){
umap[e]++;
}
for(auto e:s2){
umap[e]--;
}
for(auto e:umap){
if(e.second!=0) return false;
}
return true;
}
};