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-10-29 16:09:29 发布