How to determine if two strings are permutations of each other
bool is_permutation1(string str1, string str2) { sort(str1.begin(), str1.end()); sort(str2.begin(), str2.end()); for (int i = 0; i < str1.length(); i++) { if (str1[i] != str2[i]) { return false; } } return true; }