两个字符串是变位词
class Solution { public: /** * @param s: The first string * @param b: The second string * @return true or false */ bool anagram(string s, string t) { // write your code here vector<char> vec1,vec2; for(int i = 0; i < s.size(); ++i) vec1.push_back(s[i]); for(int j =0; j < t.size(); ++j) vec2.push_back(t[j]); sort(vec1.begin(),vec1.end()); sort(vec2.begin(),vec2.end()); return vec1 == vec2; } };