class Solution {
public:
bool isAnagram(string s, string t) {
if (s.size() != t.size()) return false;
sort(s.begin(), s.end());
sort(t.begin(), t.end());
for (int i = 0; i < s.size(); i ++) {
if (s[i] != t[i]) return false;
}
return true;
}
};
标签:sort,begin,return,string,异位,242,end,LeetCode,size
From: https://www.cnblogs.com/hjy94wo/p/16658441.html