class Solution {
public:
bool isAnagram(string s, string t) {
unordered_map<char, int> S, T;
for(auto i : s) ++S[i];
for(auto i : t) ++T[i];
return S == T ? true : false;
}
};
242 有效的字母异位词
最新推荐文章于 2022-06-22 23:35:46 发布